[FFmpeg-cvslog] Only make buffer smaller in fill_buffer() if read_packet() is set.

Carl Eugen Hoyos git at videolan.org
Mon Apr 4 16:44:52 CEST 2011


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Mon Apr  4 16:43:15 2011 +0200| [02fd687bbe15b6a3859532898c5d90bc7fa181d6] | committer: Carl Eugen Hoyos

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

Fixes a possible invalid free().

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=02fd687bbe15b6a3859532898c5d90bc7fa181d6
---

 libavformat/aviobuf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 5396eb1..152869b 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;



More information about the ffmpeg-cvslog mailing list