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 <michael@niedermayer.cc>2015-07-14 16:49:41 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-20 05:43:41 +0300
commit7dbfeeeb944893f841345d7f7b2d3039d353f675 (patch)
tree0b47ea523c49807b0a7827047086c60fb2368fad
parente604662d047606263c0d7b81cccdb992a97cd0df (diff)
ffmpeg: Fix cleanup after failed allocation of output_files
Fixes: 39a25908b84604acdaa490138282d091_signal_sigsegv_7ffff713351a_331_WAWV.avi with memlimit of 262144 Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 6e80fe1ecd984a59bb6c73cbb436cc06536b7728) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--ffmpeg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index c4e3099780..2c757bd5a4 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -455,7 +455,10 @@ static void ffmpeg_cleanup(int ret)
/* close files */
for (i = 0; i < nb_output_files; i++) {
OutputFile *of = output_files[i];
- AVFormatContext *s = of->ctx;
+ AVFormatContext *s;
+ if (!of)
+ continue;
+ s = of->ctx;
if (s && s->oformat && !(s->oformat->flags & AVFMT_NOFILE))
avio_closep(&s->pb);
avformat_free_context(s);