[FFmpeg-devel] avcodec/vaapi_h264: skip decode if pic has no slices

Peter F peter.fruehberger at gmail.com
Sat Mar 9 17:49:00 EET 2019


Resent - layer 8 issue with using a mail client, sorry for the noise:

>From 386c94489a86bb747b6531f727843cf259a24f5d Mon Sep 17 00:00:00 2001
From: xbmc <fernetmenta at online.de>
Date: Sat, 26 Jan 2019 19:48:35 +0100
Subject: [PATCH] avcodec/vaapi_h264: skip decode if pic has no slices

---
 libavcodec/vaapi_h264.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
index 5854587a25..f12fdc457a 100644
--- a/libavcodec/vaapi_h264.c
+++ b/libavcodec/vaapi_h264.c
@@ -317,6 +317,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;
-- 
2.20.1


More information about the ffmpeg-devel mailing list