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>
(cherry picked from commit dd5379db5d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-05-18 00:32:43 +02:00
parent 9733f4e4a2
commit bf085d1625
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 3 additions and 0 deletions

View File

@ -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) {