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 dd5379db5d83d8b06654582afe327daa6be678a3) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
5bc913c235
commit
61332f89a6
@ -191,6 +191,9 @@ static av_cold int vble_decode_init(AVCodecContext *avctx)
|
|||||||
ctx->size = av_image_get_buffer_size(avctx->pix_fmt,
|
ctx->size = av_image_get_buffer_size(avctx->pix_fmt,
|
||||||
avctx->width, avctx->height, 1);
|
avctx->width, avctx->height, 1);
|
||||||
|
|
||||||
|
if (ctx->size < 0)
|
||||||
|
return ctx->size;
|
||||||
|
|
||||||
ctx->val = av_malloc_array(ctx->size, sizeof(*ctx->val));
|
ctx->val = av_malloc_array(ctx->size, sizeof(*ctx->val));
|
||||||
|
|
||||||
if (!ctx->val) {
|
if (!ctx->val) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user