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

Fixes a possible invalid free().
oldabi
Carl Eugen Hoyos 14 years ago
parent 37ffba2a44
commit 02fd687bbe
  1. 2
      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;

Loading…
Cancel
Save