diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-01 22:28:14 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-01 22:28:39 +0400 |
commit | 81c3bb78aca7db56020a61f66cab3b6719a7e1b3 (patch) | |
tree | 8bad9349f07e912f1248021fc5a83253526033bf /libavformat/aviobuf.c | |
parent | 382545ae62ca2cd5ae75b4e951e7ad659e3cc5fb (diff) | |
parent | d07b51bf0733fe58bbfa13c448775dc325463cb4 (diff) |
Merge commit 'd07b51bf0733fe58bbfa13c448775dc325463cb4'
* commit 'd07b51bf0733fe58bbfa13c448775dc325463cb4':
aviobuf: Handle a NULL buffer in avio_close_dyn_buf
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r-- | libavformat/aviobuf.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 8218078dae..dc0ed717fd 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -1034,6 +1034,11 @@ int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer) static const char padbuf[FF_INPUT_BUFFER_PADDING_SIZE] = {0}; int padding = 0; + if (!s) { + *pbuffer = NULL; + return 0; + } + /* don't attempt to pad fixed-size packet buffers */ if (!s->max_packet_size) { avio_write(s, padbuf, sizeof(padbuf)); |