From d8e98d93485754b746a7d1103f33a30de08022b7 Mon Sep 17 00:00:00 2001 From: Limin Wang Date: Sat, 18 Apr 2020 12:52:47 +0800 Subject: [PATCH] avcodec/libx265: Fix Uninitialized scalar variable return error if unknown picture type encountered Fixes CID 1457234 Signed-off-by: Limin Wang --- libavcodec/libx265.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c index e42c7b4d85..573ecc8cb0 100644 --- a/libavcodec/libx265.c +++ b/libavcodec/libx265.c @@ -550,6 +550,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