aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-10-18 01:12:13 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-10-20 10:38:38 +0100
commitd7f530b0d67fe3996dbfa990a47c865e0d1400a2 (patch)
treebba6e7fb5c53a7360bd4e3713d94b9332066e25a
parent02484d1a9316a9309fc1830825345ab79f6a8d60 (diff)
downloadffmpeg-d7f530b0d67fe3996dbfa990a47c865e0d1400a2.tar.gz
aviobuf: check context before using it
Avoid a possible null pointer dereference. CC: libav-stable@libav.org Bug-Id: CID 1135769
-rw-r--r--libavformat/aviobuf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index cc79146225..6923b78ea1 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);