lavc/qsvenc: assert uninitialized pict_type
authorLinjie Fu <linjie.fu@intel.com>
Wed, 28 Nov 2018 02:41:55 +0000 (10:41 +0800)
committerZhong Li <zhong.li@intel.com>
Fri, 30 Nov 2018 09:53:26 +0000 (17:53 +0800)
Assert in function ff_qsv_encode to avoid using uninitialized value:

FF_DISABLE_DEPRECATION_WARNINGS
        avctx->coded_frame->pict_type = pict_type;
FF_ENABLE_DEPRECATION_WARNINGS

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
libavcodec/qsvenc.c

index 3946c1d..7f4592f 100644 (file)
@@ -1337,6 +1337,8 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q,
             pict_type = AV_PICTURE_TYPE_P;
         else if (bs->FrameType & MFX_FRAMETYPE_B || bs->FrameType & MFX_FRAMETYPE_xB)
             pict_type = AV_PICTURE_TYPE_B;
+        else
+            av_assert0(!"Uninitialized pict_type!");
 
 #if FF_API_CODED_FRAME
 FF_DISABLE_DEPRECATION_WARNINGS