Commit 02fd687b authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

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

Fixes a possible invalid free().
parent 37ffba2a
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment