diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-14 11:41:58 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-14 11:50:40 +0200 |
commit | 8da4305eb520bb4624df633ef124089fcfba8e6d (patch) | |
tree | 9c37cc9b56f573fd711696c55bd4926dc46be655 /libavcodec/nuv.c | |
parent | 1dee467d262d5b376fa506a0da5325b12ceea51a (diff) | |
parent | 2df0776c2293efb0ac12c003843ce19332342e01 (diff) | |
download | ffmpeg-8da4305eb520bb4624df633ef124089fcfba8e6d.tar.gz |
Merge commit '2df0776c2293efb0ac12c003843ce19332342e01'
* commit '2df0776c2293efb0ac12c003843ce19332342e01':
nuv: Use av_fast_realloc
Conflicts:
libavcodec/nuv.c
This change is not merged, the long ago fixed buffer use after codec_reinit()
was a bug.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/nuv.c')
-rw-r--r-- | libavcodec/nuv.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index 36c64fb44c..38f92e9f3d 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -122,7 +122,9 @@ 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 = 24 + height * width * 3 / 2 + FFMAX(AV_LZO_OUTPUT_PADDING, FF_INPUT_BUFFER_PADDING_SIZE); + int buf_size = height * width * 3 / 2 + + FFMAX(AV_LZO_OUTPUT_PADDING, FF_INPUT_BUFFER_PADDING_SIZE) + + RTJPEG_HEADER_SIZE; if (buf_size > INT_MAX/8) return -1; if ((ret = av_image_check_size(height, width, 0, avctx)) < 0) |