[FFmpeg-devel] [PATCH] avfilter: handle error in query_formats() in bunch of filters

Michael Niedermayer michaelni at gmx.at
Sun Apr 5 19:53:04 CEST 2015


On Sun, Apr 05, 2015 at 06:57:02PM +0200, Paul B Mahol wrote:
> On 4/5/15, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Sat, Apr 04, 2015 at 10:33:44AM +0000, Paul B Mahol wrote:
> > [...]
> >> diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c
> >> index e8492cd..485ae69 100644
> >> --- a/libavfilter/vf_cropdetect.c
> >> +++ b/libavfilter/vf_cropdetect.c
> >> @@ -62,8 +62,10 @@ static int query_formats(AVFilterContext *ctx)
> >>          AV_PIX_FMT_NONE
> >>      };
> >>
> >> -    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
> >> -    return 0;
> >> +    AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
> >
> > mixed declarations and code
> 
> I do not see it here.

i meant this here:

diff --git a/libavfilter/vf_stereo3d.c b/libavfilter/vf_stereo3d.c
index d86a7f2..7b8f63b 100644
--- a/libavfilter/vf_stereo3d.c
+++ b/libavfilter/vf_stereo3d.c
@@ -278,9 +278,10 @@ static int query_formats(AVFilterContext *ctx)
         pix_fmts = other_pix_fmts;
     }

-    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
-
-    return 0;
+    AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
+    if (!fmts_list)
+        return AVERROR(ENOMEM);
+    return ff_set_common_formats(ctx, fmts_list);
 }

no more comments from me, rest probably ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150405/d9120c84/attachment.asc>


More information about the ffmpeg-devel mailing list