1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

aviobuf: check context before using it

Avoid a possible null pointer dereference.

CC: libav-stable@libav.org
Bug-Id: CID 1135769
This commit is contained in:
Vittorio Giovara 2014-10-18 01:12:13 +01:00
parent 02484d1a93
commit d7f530b0d6

View File

@ -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);