[FFmpeg-devel] [PATCH] af_pan: avoid null dereference on query_formats()

Reynaldo H. Verdejo Pinochet reynaldo at osg.samsung.com
Thu Oct 8 21:06:24 CEST 2015


Fixes Coverity CID 1325680

Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo at osg.samsung.com>
---
 libavfilter/af_pan.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c
index 9117cc0..91cc434 100644
--- a/libavfilter/af_pan.c
+++ b/libavfilter/af_pan.c
@@ -239,6 +239,10 @@ static int query_formats(AVFilterContext *ctx)
 
     // inlink supports any channel layout
     layouts = ff_all_channel_counts();
+    if (!layouts) {
+        av_freep(formats);
+        return AVERROR(ENOMEM);
+    }
     ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts);
 
     // outlink supports only requested output channel layout
-- 
2.5.1



More information about the ffmpeg-devel mailing list