diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2011-04-04 16:43:15 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2011-04-04 16:43:15 +0200 |
commit | 02fd687bbe15b6a3859532898c5d90bc7fa181d6 (patch) | |
tree | 9af3abb58ad45caabb2d4846f162b4b0fbc3ec8e /libavformat/aviobuf.c | |
parent | 37ffba2a445b2ec82ea3096041f29ffca0af99d1 (diff) | |
download | ffmpeg-02fd687bbe15b6a3859532898c5d90bc7fa181d6.tar.gz |
Only make buffer smaller in fill_buffer() if read_packet() is set.
Fixes a possible invalid free().
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r-- | libavformat/aviobuf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 5396eb1635..152869bacd 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -556,7 +556,7 @@ static void fill_buffer(AVIOContext *s) } /* make buffer smaller in case it ended up large after probing */ - if (s->buffer_size > max_buffer_size) { + if (s->read_packet && s->buffer_size > max_buffer_size) { ffio_set_buf_size(s, max_buffer_size); s->checksum_ptr = dst = s->buffer; |