summaryrefslogtreecommitdiff
path: root/libavformat/aviobuf.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-11 16:16:04 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-11 16:16:04 +0100
commit7441d1ec330da810a0ffd44a02b2fc60add5b719 (patch)
tree8b64b3876206fb7ee2d38c72a671d8766d79c2b4 /libavformat/aviobuf.c
parent0fe6906d96cce8621e22a91c7d0106f7b03610fd (diff)
avformat/aviobuf: fix null dereference in avio_close_dyn_buf()
Fixes CID1135769 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r--libavformat/aviobuf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 8b4511d177..eb5a6e502d 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -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) {