[FFmpeg-cvslog] avdevice/lavfi: add error checking for av_opt_set_int_list()

Michael Niedermayer git at videolan.org
Fri Apr 12 20:41:16 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Apr 12 20:34:35 2013 +0200| [9b595e86e342e0e39c5ddf9020286cae258b9965] | committer: Michael Niedermayer

avdevice/lavfi: add error checking for av_opt_set_int_list()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavdevice/lavfi.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index 15ac055..c1c9cf5 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -230,8 +230,8 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
             ret = avfilter_graph_create_filter(&sink, buffersink,
                                                inout->name, NULL,
                                                NULL, lavfi->graph);
-            av_opt_set_int_list(sink, "pix_fmts", pix_fmts,  AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN);
-
+            if (ret >= 0)
+                ret = av_opt_set_int_list(sink, "pix_fmts", pix_fmts,  AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN);
             if (ret < 0)
                 goto end;
         } else if (type == AVMEDIA_TYPE_AUDIO) {
@@ -244,8 +244,8 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
             ret = avfilter_graph_create_filter(&sink, abuffersink,
                                                inout->name, NULL,
                                                NULL, lavfi->graph);
-
-            av_opt_set_int_list(sink, "sample_fmts", sample_fmts,  AV_SAMPLE_FMT_NONE, AV_OPT_SEARCH_CHILDREN);
+            if (ret >= 0)
+                ret = av_opt_set_int_list(sink, "sample_fmts", sample_fmts,  AV_SAMPLE_FMT_NONE, AV_OPT_SEARCH_CHILDREN);
             if (ret < 0)
                 goto end;
         }



More information about the ffmpeg-cvslog mailing list