aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoren Merritt <lorenm@u.washington.edu>2005-02-28 05:27:21 +0000
committerLoren Merritt <lorenm@u.washington.edu>2005-02-28 05:27:21 +0000
commit56b31a8ee2fa07d2a26e4fe2976157da6c1af637 (patch)
tree3f5a402ec01276aaba8a402cbdcb2730fa763a88
parent386b26c9fe5e6e82a0b8f9476d584651fcdaaf74 (diff)
downloadffmpeg-56b31a8ee2fa07d2a26e4fe2976157da6c1af637.tar.gz
10l (deallocated memory again)
Originally committed as revision 3994 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/flac.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libavcodec/flac.c b/libavcodec/flac.c
index de1c5255ce..894da93848 100644
--- a/libavcodec/flac.c
+++ b/libavcodec/flac.c
@@ -637,10 +637,17 @@ static int flac_decode_frame(AVCodecContext *avctx,
switch(metadata_type)
{
case METADATA_TYPE_STREAMINFO:{
- int bits_count= get_bits_count(&s->gb);
-
metadata_streaminfo(s);
+ /* Buffer might have been reallocated, reinit bitreader */
+ if(buf != &s->bitstream[s->bitstream_index])
+ {
+ int bits_count = get_bits_count(&s->gb);
+ buf= &s->bitstream[s->bitstream_index];
+ init_get_bits(&s->gb, buf, buf_size*8);
+ skip_bits(&s->gb, bits_count);
+ }
+
dump_headers(s);
break;}
default: