Browse Source

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
tags/v0.5
Michael Niedermayer 17 years ago
parent
commit
cfcd396bae
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavcodec/flac.c

+ 2
- 1
libavcodec/flac.c View File

@@ -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,


Loading…
Cancel
Save