diff mbox series

[FFmpeg-devel,v2,1/2] avcodec/libx265: Fix Uninitialized scalar variable

Message ID 20200117044848.2829-1-lance.lmwang@gmail.com
State Superseded
Headers show
Series [FFmpeg-devel,v2,1/2] avcodec/libx265: Fix Uninitialized scalar variable
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Limin Wang Jan. 17, 2020, 4:48 a.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

return error if unknown picture type encountered

Fixes CID 1457234
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavcodec/libx265.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 9e4711e..a5cf3d6 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -549,6 +549,9 @@  static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     case X265_TYPE_BREF:
         pict_type = AV_PICTURE_TYPE_B;
         break;
+    default:
+        av_log(avctx, AV_LOG_ERROR, "Unknown picture type encountered.\n");
+        return AVERROR_EXTERNAL;
     }
 
 #if FF_API_CODED_FRAME