libavfilter/vf_hwdownload.c:53: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned32 by call to `ff_formats_unref`.

libavfilter/vf_hwdownload.c:49:19: Call
47.          desc = av_pix_fmt_desc_next(desc)) {
48.         if (desc->flags & AV_PIX_FMT_FLAG_HWACCEL)
49.             err = ff_add_format(&infmts,  av_pix_fmt_desc_get_id(desc));
                      ^
50.         else
51.             err = ff_add_format(&outfmts, av_pix_fmt_desc_get_id(desc));

libavfilter/formats.c:208:1: Parameter `(*avff)->nb_formats`
  206. } while (0)
  207. 
  208. int ff_add_format(AVFilterFormats **avff, int fmt)
       ^
  209. {
  210.     ADD_FORMAT(avff, fmt, int, formats, nb_formats);

libavfilter/vf_hwdownload.c:53:13: Call
51.             err = ff_add_format(&outfmts, av_pix_fmt_desc_get_id(desc));
52.         if (err) {
53.             ff_formats_unref(&infmts);
                ^
54.             ff_formats_unref(&outfmts);
55.             return err;

libavfilter/formats.c:312:1: <LHS trace>
310. } while (0)
311. 
312. void ff_formats_unref(AVFilterFormats **ref)
     ^
313. {
314.     FORMATS_UNREF(ref, formats);

libavfilter/formats.c:312:1: Parameter `(*ref)->refcount`
  310. } while (0)
  311. 
  312. void ff_formats_unref(AVFilterFormats **ref)
       ^
  313. {
  314.     FORMATS_UNREF(ref, formats);

libavfilter/formats.c:314:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `ff_formats_unref` 
  312. void ff_formats_unref(AVFilterFormats **ref)
  313. {
  314.     FORMATS_UNREF(ref, formats);
           ^
  315. }
  316. 

void ff_formats_unref(AVFilterFormats **ref)
{
    FORMATS_UNREF(ref, formats);
}
['static int hwdownload_query_formats(AVFilterContext *avctx)\n{\n    AVFilterFormats  *infmts = NULL;\n    AVFilterFormats *outfmts = NULL;\n    const AVPixFmtDescriptor *desc;\n    int err;\n    for (desc = av_pix_fmt_desc_next(NULL); desc;\n         desc = av_pix_fmt_desc_next(desc)) {\n        if (desc->flags & AV_PIX_FMT_FLAG_HWACCEL)\n            err = ff_add_format(&infmts,  av_pix_fmt_desc_get_id(desc));\n        else\n            err = ff_add_format(&outfmts, av_pix_fmt_desc_get_id(desc));\n        if (err) {\n            ff_formats_unref(&infmts);\n            ff_formats_unref(&outfmts);\n            return err;\n        }\n    }\n    ff_formats_ref(infmts,  &avctx->inputs[0]->out_formats);\n    ff_formats_ref(outfmts, &avctx->outputs[0]->in_formats);\n    return 0;\n}', 'int ff_add_format(AVFilterFormats **avff, int fmt)\n{\n    ADD_FORMAT(avff, fmt, int, formats, nb_formats);\n}', 'void ff_formats_unref(AVFilterFormats **ref)\n{\n    FORMATS_UNREF(ref, formats);\n}']