[FFmpeg-cvslog] aviobuf: check context before using it

Vittorio Giovara git at videolan.org
Sun Jan 18 01:09:33 CET 2015


ffmpeg | branch: release/2.4 | Vittorio Giovara <vittorio.giovara at gmail.com> | Sat Oct 18 01:12:13 2014 +0100| [6cf27b550d66963b89b5917568b85c4b49fb18ba] | committer: Vittorio Giovara

aviobuf: check context before using it

Avoid a possible null pointer dereference.

CC: libav-stable at libav.org
Bug-Id: CID 1135769

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

 libavformat/aviobuf.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index cc79146..6923b78 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -965,7 +965,7 @@ int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size)
 
 int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
 {
-    DynBuffer *d = s->opaque;
+    DynBuffer *d;
     int size;
     static const char padbuf[FF_INPUT_BUFFER_PADDING_SIZE] = {0};
     int padding = 0;
@@ -983,6 +983,7 @@ int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
 
     avio_flush(s);
 
+    d = s->opaque;
     *pbuffer = d->buffer;
     size = d->size;
     av_free(d);



More information about the ffmpeg-cvslog mailing list