[FFmpeg-devel] [PATCH 2/3] lavfi/af_pan: check ff_add_channel_layout() return.

Nicolas George george at nsup.org
Tue Oct 6 10:18:19 CEST 2015


Signed-off-by: Nicolas George <george at nsup.org>
---
 libavfilter/af_pan.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c
index d116818..5062252 100644
--- a/libavfilter/af_pan.c
+++ b/libavfilter/af_pan.c
@@ -227,6 +227,7 @@ static int query_formats(AVFilterContext *ctx)
     AVFilterLink *outlink = ctx->outputs[0];
     AVFilterFormats *formats = NULL;
     AVFilterChannelLayouts *layouts;
+    int ret;
 
     pan->pure_gains = are_gains_pure(pan);
     /* libswr supports any sample and packing formats */
@@ -245,9 +246,11 @@ static int query_formats(AVFilterContext *ctx)
 
     // outlink supports only requested output channel layout
     layouts = NULL;
-    ff_add_channel_layout(&layouts,
-                          pan->out_channel_layout ? pan->out_channel_layout :
-                          FF_COUNT2LAYOUT(pan->nb_output_channels));
+    ret = ff_add_channel_layout(&layouts,
+                                pan->out_channel_layout ? pan->out_channel_layout :
+                                FF_COUNT2LAYOUT(pan->nb_output_channels));
+    if (ret < 0)
+        return ret;
     ff_channel_layouts_ref(layouts, &outlink->in_channel_layouts);
     return 0;
 }
-- 
2.5.3



More information about the ffmpeg-devel mailing list