[FFmpeg-devel] [PATCH v3 3/3] avcodec/libx264: return error if unknown picture type encountered

lance.lmwang at gmail.com lance.lmwang at gmail.com
Sat Apr 18 07:52:49 EEST 2020


From: Limin Wang <lance.lmwang at gmail.com>

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
 libavcodec/libx264.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index edd343e..3fa2311 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -476,7 +476,8 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
         pict_type = AV_PICTURE_TYPE_B;
         break;
     default:
-        pict_type = AV_PICTURE_TYPE_NONE;
+        av_log(ctx, AV_LOG_ERROR, "Unknown picture type encountered.\n");
+        return AVERROR_EXTERNAL;
     }
 #if FF_API_CODED_FRAME
 FF_DISABLE_DEPRECATION_WARNINGS
-- 
2.9.5



More information about the ffmpeg-devel mailing list