ffmpeg | branch: release/7.0 | Michael Niedermayer <mich...@niedermayer.cc> | 
Sat May 18 00:32:43 2024 +0200| [68763d6a6ffc7bc561513469f43afb51047a4b09] | 
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.xi...@intel.com>
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
(cherry picked from commit dd5379db5d83d8b06654582afe327daa6be678a3)
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

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

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

diff --git a/libavcodec/vble.c b/libavcodec/vble.c
index 7711bf1bb1..d27ab658dd 100644
--- a/libavcodec/vble.c
+++ b/libavcodec/vble.c
@@ -191,6 +191,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) {

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to