Mercurial > libavcodec.hg
diff flac.c @ 2529:f6a13db551aa libavcodec
10l (deallocated memory again)
author | lorenm |
---|---|
date | Mon, 28 Feb 2005 05:27:21 +0000 |
parents | e25782262d7d |
children | 511e3afc43e1 |
line wrap: on
line diff
--- a/flac.c Sun Feb 27 23:43:24 2005 +0000 +++ b/flac.c Mon Feb 28 05:27:21 2005 +0000 @@ -637,10 +637,17 @@ 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: