1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

Only make buffer smaller in fill_buffer() if read_packet() is set.

Fixes a possible invalid free().
This commit is contained in:
Carl Eugen Hoyos 2011-04-04 16:43:15 +02:00
parent 37ffba2a44
commit 02fd687bbe

View File

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