OSDN Git Service

Merge commit '2df0776c2293efb0ac12c003843ce19332342e01'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 14 Aug 2013 09:41:58 +0000 (11:41 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 14 Aug 2013 09:50:40 +0000 (11:50 +0200)
* 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>
1  2 
libavcodec/nuv.c

@@@ -121,10 -120,7 +121,12 @@@ static int codec_reinit(AVCodecContext 
      if (quality >= 0)
          get_quant_quality(c, quality);
      if (width != c->width || height != c->height) {
 -        void *ptr;
 +        // 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)
              return ret;
          avctx->width  = c->width  = width;