Commit cfcd396b authored by Michael Niedermayer's avatar Michael Niedermayer

Only realloc() bitstream buffer when the needed size increased,

this is needed to prevent loosing bitstream data with large metadata.

Originally committed as revision 14279 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 2b4b8c82
......@@ -139,7 +139,8 @@ static void allocate_buffers(FLACContext *s){
s->decoded[i] = av_realloc(s->decoded[i], sizeof(int32_t)*s->max_blocksize);
}
s->bitstream= av_fast_realloc(s->bitstream, &s->allocated_bitstream_size, s->max_framesize);
if(s->allocated_bitstream_size < s->max_framesize)
s->bitstream= av_fast_realloc(s->bitstream, &s->allocated_bitstream_size, s->max_framesize);
}
void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment