[FFmpeg-cvslog] libavfilter/af_amix: avoid derreferencing possible null

Reynaldo H. Verdejo Pinochet git at videolan.org
Fri Sep 26 23:54:26 CEST 2014


ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet <reynaldo at osg.samsung.com> | Fri Sep 26 16:37:28 2014 -0300| [a9ea79bb4976382b5648647013290ab61cf031e7] | committer: Reynaldo H. Verdejo Pinochet

libavfilter/af_amix: avoid derreferencing possible null

ff_all_channel_layouts() might return null on alloc failure.

Fixes CID1241516

Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo at osg.samsung.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a9ea79bb4976382b5648647013290ab61cf031e7
---

 libavfilter/af_amix.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c
index d8a6651..47cbb45 100644
--- a/libavfilter/af_amix.c
+++ b/libavfilter/af_amix.c
@@ -528,10 +528,17 @@ static av_cold void uninit(AVFilterContext *ctx)
 static int query_formats(AVFilterContext *ctx)
 {
     AVFilterFormats *formats = NULL;
+    AVFilterChannelLayouts *layouts;
+
+    layouts = ff_all_channel_layouts();
+
+    if (!layouts)
+        return AVERROR(ENOMEM);
+
     ff_add_format(&formats, AV_SAMPLE_FMT_FLT);
     ff_add_format(&formats, AV_SAMPLE_FMT_FLTP);
     ff_set_common_formats(ctx, formats);
-    ff_set_common_channel_layouts(ctx, ff_all_channel_layouts());
+    ff_set_common_channel_layouts(ctx, layouts);
     ff_set_common_samplerates(ctx, ff_all_samplerates());
     return 0;
 }



More information about the ffmpeg-cvslog mailing list