[FFmpeg-devel] [PATCH, v2] lavc/qsvenc: assert uninitialized pict_type
Linjie Fu
linjie.fu at intel.com
Wed Nov 28 04:41:55 EET 2018
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 at intel.com>
---
[v2] assert instead of setting the pict_type to AV_PICTURE_TYPE_NONE;
libavcodec/qsvenc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 7a031297fe..fd9f4f0934 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -1333,6 +1333,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
--
2.17.1
More information about the ffmpeg-devel
mailing list