[FFmpeg-cvslog] avcodec/vble: Check av_image_get_buffer_size() for failure

Michael Niedermayer git at videolan.org
Fri Jun 14 22:20:13 EEST 2024


ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Sat May 18 00:32:43 2024 +0200| [590a0b5f3334611d4e62ba7db1d3c41ecd83fe66] | committer: Michael Niedermayer

avcodec/vble: Check av_image_get_buffer_size() for failure

Fixes: CID1461482 Improper use of negative value

Sponsored-by: Sovereign Tech Fund
Reviewed-.by: "Xiang, Haihao" <haihao.xiang at intel.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit dd5379db5d83d8b06654582afe327daa6be678a3)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=590a0b5f3334611d4e62ba7db1d3c41ecd83fe66
---

 libavcodec/vble.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/vble.c b/libavcodec/vble.c
index c48c13127a..27dced0fd5 100644
--- a/libavcodec/vble.c
+++ b/libavcodec/vble.c
@@ -193,6 +193,9 @@ static av_cold int vble_decode_init(AVCodecContext *avctx)
     ctx->size = av_image_get_buffer_size(avctx->pix_fmt,
                                          avctx->width, avctx->height, 1);
 
+    if (ctx->size < 0)
+        return ctx->size;
+
     ctx->val = av_malloc_array(ctx->size, sizeof(*ctx->val));
 
     if (!ctx->val) {



More information about the ffmpeg-cvslog mailing list