parser: fix large overreads
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 3 Oct 2012 14:06:23 +0000 (16:06 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 3 Oct 2012 14:14:59 +0000 (16:14 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/parser.c

index a85db1a..127ba8b 100644 (file)
@@ -261,6 +261,7 @@ int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_s
         if(!new_buffer)
             return AVERROR(ENOMEM);
         pc->buffer = new_buffer;
+        if(FF_INPUT_BUFFER_PADDING_SIZE > -next)
         memcpy(&pc->buffer[pc->index], *buf, next + FF_INPUT_BUFFER_PADDING_SIZE );
         pc->index = 0;
         *buf= pc->buffer;