libavfilter/formats.c:374: error: Memory Leak
  memory dynamically allocated by call to `ff_channel_layouts_ref()` at line 374, column 5 is not reachable after line 374, column 5.

libavfilter/formats.c:371:1: start of procedure ff_set_common_channel_layouts()
369. }
370. 
371. void ff_set_common_channel_layouts(AVFilterContext *ctx,
     ^
372.                                    AVFilterChannelLayouts *layouts)
373. {

libavfilter/formats.c:374:5: Loop condition is true. Entering loop body
372.                                    AVFilterChannelLayouts *layouts)
373. {
374.     SET_COMMON_FORMATS(ctx, layouts, in_channel_layouts, out_channel_layouts,
         ^
375.                        ff_channel_layouts_ref, channel_layouts);
376. }

libavfilter/formats.c:374:5: Taking true branch
372.                                    AVFilterChannelLayouts *layouts)
373. {
374.     SET_COMMON_FORMATS(ctx, layouts, in_channel_layouts, out_channel_layouts,
         ^
375.                        ff_channel_layouts_ref, channel_layouts);
376. }

libavfilter/formats.c:272:1: start of procedure ff_channel_layouts_ref()
  270. } while (0)
  271. 
  272. void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref)
       ^
  273. {
  274.     FORMATS_REF(f, ref);

libavfilter/formats.c:274:5: 
  272. void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref)
  273. {
  274.     FORMATS_REF(f, ref);
           ^
  275. }
  276. 

libavutil/mem.c:117:1: start of procedure av_realloc()
    115. }
    116. 
    117. void *av_realloc(void *ptr, size_t size)
         ^
    118. {
    119. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:124:9: Taking false branch
    122. 
    123.     /* let's disallow possibly ambiguous cases */
    124.     if (size > (INT_MAX - 16))
                 ^
    125.         return NULL;
    126. 

libavutil/mem.c:136:5: 
    134.     return _aligned_realloc(ptr, size, 32);
    135. #else
    136.     return realloc(ptr, size);
             ^
    137. #endif
    138. }

libavutil/mem.c:138:1: return from a call to av_realloc
    136.     return realloc(ptr, size);
    137. #endif
    138. }
         ^
    139. 
    140. int av_reallocp(void *ptr, size_t size)

libavfilter/formats.c:274:5: Taking false branch
  272. void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref)
  273. {
  274.     FORMATS_REF(f, ref);
           ^
  275. }
  276. 

libavfilter/formats.c:274:5: Loop condition is false. Leaving loop
  272. void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref)
  273. {
  274.     FORMATS_REF(f, ref);
           ^
  275. }
  276. 

libavfilter/formats.c:275:1: return from a call to ff_channel_layouts_ref
  273. {
  274.     FORMATS_REF(f, ref);
  275. }
       ^
  276. 
  277. void ff_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)

libavfilter/formats.c:374:5: Loop condition is true. Entering loop body
372.                                    AVFilterChannelLayouts *layouts)
373. {
374.     SET_COMMON_FORMATS(ctx, layouts, in_channel_layouts, out_channel_layouts,
         ^
375.                        ff_channel_layouts_ref, channel_layouts);
376. }

libavfilter/formats.c:374:5: Taking true branch
372.                                    AVFilterChannelLayouts *layouts)
373. {
374.     SET_COMMON_FORMATS(ctx, layouts, in_channel_layouts, out_channel_layouts,
         ^
375.                        ff_channel_layouts_ref, channel_layouts);
376. }

libavfilter/formats.c:272:1: start of procedure ff_channel_layouts_ref()
  270. } while (0)
  271. 
  272. void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref)
       ^
  273. {
  274.     FORMATS_REF(f, ref);

libavfilter/formats.c:274:5: 
  272. void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref)
  273. {
  274.     FORMATS_REF(f, ref);
           ^
  275. }
  276. 

libavutil/mem.c:117:1: start of procedure av_realloc()
    115. }
    116. 
    117. void *av_realloc(void *ptr, size_t size)
         ^
    118. {
    119. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:124:9: Taking true branch
    122. 
    123.     /* let's disallow possibly ambiguous cases */
    124.     if (size > (INT_MAX - 16))
                 ^
    125.         return NULL;
    126. 

libavutil/mem.c:125:9: 
    123.     /* let's disallow possibly ambiguous cases */
    124.     if (size > (INT_MAX - 16))
    125.         return NULL;
                 ^
    126. 
    127. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:138:1: return from a call to av_realloc
    136.     return realloc(ptr, size);
    137. #endif
    138. }
         ^
    139. 
    140. int av_reallocp(void *ptr, size_t size)

libavfilter/formats.c:274:5: Taking true branch
  272. void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref)
  273. {
  274.     FORMATS_REF(f, ref);
           ^
  275. }
  276. 

libavfilter/formats.c:275:1: return from a call to ff_channel_layouts_ref
  273. {
  274.     FORMATS_REF(f, ref);
  275. }
       ^
  276. 
  277. void ff_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)

void ff_set_common_channel_layouts(AVFilterContext *ctx,
                                   AVFilterChannelLayouts *layouts)
{
    SET_COMMON_FORMATS(ctx, layouts, in_channel_layouts, out_channel_layouts,
                       ff_channel_layouts_ref, channel_layouts);
}
['void ff_set_common_channel_layouts(AVFilterContext *ctx,\n                                   AVFilterChannelLayouts *layouts)\n{\n    SET_COMMON_FORMATS(ctx, layouts, in_channel_layouts, out_channel_layouts,\n                       ff_channel_layouts_ref, channel_layouts);\n}', 'void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref)\n{\n    FORMATS_REF(f, ref);\n}', 'void *av_realloc(void *ptr, size_t size)\n{\n#if CONFIG_MEMALIGN_HACK\n    int diff;\n#endif\n    if (size > (INT_MAX - 16))\n        return NULL;\n#if CONFIG_MEMALIGN_HACK\n    if (!ptr)\n        return av_malloc(size);\n    diff = ((char *)ptr)[-1];\n    return (char *)realloc((char *)ptr - diff, size + diff) + diff;\n#elif HAVE_ALIGNED_MALLOC\n    return _aligned_realloc(ptr, size, 32);\n#else\n    return realloc(ptr, size);\n#endif\n}']