diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2024-05-18 00:32:43 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2024-05-19 22:12:54 +0200 |
commit | dd5379db5d83d8b06654582afe327daa6be678a3 (patch) | |
tree | 5c6a0d8cfbd23568d0fec82288eede0ff9d228c2 | |
parent | 1b991e77b9b19392214f6a788541bea5662de337 (diff) | |
download | ffmpeg-dd5379db5d83d8b06654582afe327daa6be678a3.tar.gz |
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@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/vble.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/vble.c b/libavcodec/vble.c index c5d92bd6f5..4511433a6c 100644 --- a/libavcodec/vble.c +++ b/libavcodec/vble.c @@ -187,6 +187,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) { |