Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-06 02:39:58 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-04-10 06:53:00 +0400
commit34592d04fbeaf3dc993650f1fcf54ed76af9b26b (patch)
treef474f5ebe43662291b8a7ba78d420e6942de6504 /doc/examples
parent544accc895f33c52cf7f097b9c6c6d3eeadc6134 (diff)
examples/avio_reading: fix null dereference on error
Fixed CID1197052 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 419800acc46afc0c3b7319d6e216d0da207ebbb7) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'doc/examples')
-rw-r--r--doc/examples/avio_reading.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/examples/avio_reading.c b/doc/examples/avio_reading.c
index 45dbd4725a..02474e907a 100644
--- a/doc/examples/avio_reading.c
+++ b/doc/examples/avio_reading.c
@@ -119,8 +119,10 @@ int main(int argc, char *argv[])
end:
avformat_close_input(&fmt_ctx);
/* note: the internal buffer could have changed, and be != avio_ctx_buffer */
- av_freep(&avio_ctx->buffer);
- av_freep(&avio_ctx);
+ if (avio_ctx) {
+ av_freep(&avio_ctx->buffer);
+ av_freep(&avio_ctx);
+ }
av_file_unmap(buffer, buffer_size);
if (ret < 0) {