diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index 3d394b50c6..d9f0162a6d 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -123,7 +123,7 @@ static int codec_reinit(AVCodecContext *avctx, int width, int height, get_quant_quality(c, quality); if (width != c->width || height != c->height) { // also reserve space for a possible additional header - int buf_size = height * width * 3 / 2 + int64_t buf_size = height * (int64_t)width * 3 / 2 + FFMAX(AV_LZO_OUTPUT_PADDING, AV_INPUT_BUFFER_PADDING_SIZE) + RTJPEG_HEADER_SIZE; if (buf_size > INT_MAX/8)