Skip to content
This repository has been archived by the owner on Jun 4, 2023. It is now read-only.

Commit

Permalink
avcodec/vaapi_h264: skip decode if pic has no slices
Browse files Browse the repository at this point in the history
This fixes / workarounds https://bugs.freedesktop.org/show_bug.cgi?id=105368.
It was hit frequently when watching h264 channels received via DVB-X.
Corresponding kodi bug: xbmc/xbmc#15704
  • Loading branch information
FernetMenta authored and lrusak committed Apr 10, 2021
1 parent dc32afa commit 081225c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libavcodec/vaapi_h264.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx)
H264SliceContext *sl = &h->slice_ctx[0];
int ret;

if (pic->nb_slices == 0) {
ret = AVERROR_INVALIDDATA;
goto finish;
}

ret = ff_vaapi_decode_issue(avctx, pic);
if (ret < 0)
goto finish;
Expand Down

0 comments on commit 081225c

Please sign in to comment.