Commit 7441d1ec authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/aviobuf: fix null dereference in avio_close_dyn_buf()

Fixes CID1135769
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 0fe6906d
......@@ -1036,7 +1036,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;
......@@ -1045,6 +1045,7 @@ int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
*pbuffer = NULL;
return 0;
}
d = s->opaque;
/* don't attempt to pad fixed-size packet buffers */
if (!s->max_packet_size) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment