cmdutils.c:1588: error: Memory Leak
  memory dynamically allocated by call to `av_strndup()` at line 1575, column 21 is not reachable after line 1588, column 9.

cmdutils.c:1514:1: start of procedure check_stream_specifier()
1512. }
1513. 
1514. int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
      ^
1515. {
1516.     if (*spec <= '9' && *spec >= '0') /* opt:index */

cmdutils.c:1516:9: Taking false branch
1514. int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
1515. {
1516.     if (*spec <= '9' && *spec >= '0') /* opt:index */
              ^
1517.         return strtol(spec, NULL, 0) == st->index;
1518.     else if (*spec == 'v' || *spec == 'a' || *spec == 's' || *spec == 'd' ||

cmdutils.c:1518:14: Taking false branch
1516.     if (*spec <= '9' && *spec >= '0') /* opt:index */
1517.         return strtol(spec, NULL, 0) == st->index;
1518.     else if (*spec == 'v' || *spec == 'a' || *spec == 's' || *spec == 'd' ||
                   ^
1519.              *spec == 't') { /* opt:[vasdt] */
1520.         enum AVMediaType type;

cmdutils.c:1518:30: Taking false branch
1516.     if (*spec <= '9' && *spec >= '0') /* opt:index */
1517.         return strtol(spec, NULL, 0) == st->index;
1518.     else if (*spec == 'v' || *spec == 'a' || *spec == 's' || *spec == 'd' ||
                                   ^
1519.              *spec == 't') { /* opt:[vasdt] */
1520.         enum AVMediaType type;

cmdutils.c:1518:46: Taking false branch
1516.     if (*spec <= '9' && *spec >= '0') /* opt:index */
1517.         return strtol(spec, NULL, 0) == st->index;
1518.     else if (*spec == 'v' || *spec == 'a' || *spec == 's' || *spec == 'd' ||
                                                   ^
1519.              *spec == 't') { /* opt:[vasdt] */
1520.         enum AVMediaType type;

cmdutils.c:1518:62: Taking false branch
1516.     if (*spec <= '9' && *spec >= '0') /* opt:index */
1517.         return strtol(spec, NULL, 0) == st->index;
1518.     else if (*spec == 'v' || *spec == 'a' || *spec == 's' || *spec == 'd' ||
                                                                   ^
1519.              *spec == 't') { /* opt:[vasdt] */
1520.         enum AVMediaType type;

cmdutils.c:1519:14: Taking false branch
1517.         return strtol(spec, NULL, 0) == st->index;
1518.     else if (*spec == 'v' || *spec == 'a' || *spec == 's' || *spec == 'd' ||
1519.              *spec == 't') { /* opt:[vasdt] */
                   ^
1520.         enum AVMediaType type;
1521. 

cmdutils.c:1540:16: Taking false branch
1538.         }
1539.         return 1;
1540.     } else if (*spec == 'p' && *(spec + 1) == ':') {
                     ^
1541.         int prog_id, i, j;
1542.         char *endptr;

cmdutils.c:1561:16: Taking false branch
1559.         }
1560.         return 0;
1561.     } else if (*spec == 'i' && *(spec + 1) == ':') {
                     ^
1562.         int stream_id;
1563.         char *endptr;

cmdutils.c:1567:16: Taking true branch
1565.         stream_id = strtol(spec, &endptr, 0);
1566.         return stream_id == st->id;
1567.     } else if (*spec == 'm' && *(spec + 1) == ':') {
                     ^
1568.         AVDictionaryEntry *tag;
1569.         char *key, *val;

cmdutils.c:1567:32: Taking true branch
1565.         stream_id = strtol(spec, &endptr, 0);
1566.         return stream_id == st->id;
1567.     } else if (*spec == 'm' && *(spec + 1) == ':') {
                                     ^
1568.         AVDictionaryEntry *tag;
1569.         char *key, *val;

cmdutils.c:1572:9: 
1570.         int ret;
1571. 
1572.         spec += 2;
              ^
1573.         val = strchr(spec, ':');
1574. 

cmdutils.c:1573:9: 
1571. 
1572.         spec += 2;
1573.         val = strchr(spec, ':');
              ^
1574. 
1575.         key = val ? av_strndup(spec, val - spec) : av_strdup(spec);

cmdutils.c:1575:15: Condition is true
1573.         val = strchr(spec, ':');
1574. 
1575.         key = val ? av_strndup(spec, val - spec) : av_strdup(spec);
                    ^
1576.         if (!key)
1577.             return AVERROR(ENOMEM);

libavutil/mem.c:231:1: start of procedure av_strndup()
  229. }
  230. 
  231. char *av_strndup(const char *s, size_t len)
       ^
  232. {
  233.     char *ret = NULL, *end;

libavutil/mem.c:233:5: 
  231. char *av_strndup(const char *s, size_t len)
  232. {
  233.     char *ret = NULL, *end;
           ^
  234. 
  235.     if (!s)

libavutil/mem.c:235:10: Taking false branch
  233.     char *ret = NULL, *end;
  234. 
  235.     if (!s)
                ^
  236.         return NULL;
  237. 

libavutil/mem.c:238:5: 
  236.         return NULL;
  237. 
  238.     end = memchr(s, 0, len);
           ^
  239.     if (end)
  240.         len = end - s;

libavutil/mem.c:239:9: Taking true branch
  237. 
  238.     end = memchr(s, 0, len);
  239.     if (end)
               ^
  240.         len = end - s;
  241. 

libavutil/mem.c:240:9: 
  238.     end = memchr(s, 0, len);
  239.     if (end)
  240.         len = end - s;
               ^
  241. 
  242.     ret = av_realloc(NULL, len + 1);

libavutil/mem.c:242:5: 
  240.         len = end - s;
  241. 
  242.     ret = av_realloc(NULL, len + 1);
           ^
  243.     if (!ret)
  244.         return NULL;

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)

libavutil/mem.c:243:10: Taking false branch
  241. 
  242.     ret = av_realloc(NULL, len + 1);
  243.     if (!ret)
                ^
  244.         return NULL;
  245. 

libavutil/mem.c:246:5: 
  244.         return NULL;
  245. 
  246.     memcpy(ret, s, len);
           ^
  247.     ret[len] = 0;
  248.     return ret;

libavutil/mem.c:247:5: 
  245. 
  246.     memcpy(ret, s, len);
  247.     ret[len] = 0;
           ^
  248.     return ret;
  249. }

libavutil/mem.c:248:5: 
  246.     memcpy(ret, s, len);
  247.     ret[len] = 0;
  248.     return ret;
           ^
  249. }
  250. 

libavutil/mem.c:249:1: return from a call to av_strndup
  247.     ret[len] = 0;
  248.     return ret;
  249. }
       ^
  250. 
  251. static void fill16(uint8_t *dst, int len)

cmdutils.c:1575:9: 
1573.         val = strchr(spec, ':');
1574. 
1575.         key = val ? av_strndup(spec, val - spec) : av_strdup(spec);
              ^
1576.         if (!key)
1577.             return AVERROR(ENOMEM);

cmdutils.c:1576:14: Taking false branch
1574. 
1575.         key = val ? av_strndup(spec, val - spec) : av_strdup(spec);
1576.         if (!key)
                   ^
1577.             return AVERROR(ENOMEM);
1578. 

cmdutils.c:1579:9: Skipping av_dict_get(): empty list of specs
1577.             return AVERROR(ENOMEM);
1578. 
1579.         tag = av_dict_get(st->metadata, key, NULL, 0);
              ^
1580.         if (tag) {
1581.             if (!val || !strcmp(tag->value, val + 1))

cmdutils.c:1580:13: Taking true branch
1578. 
1579.         tag = av_dict_get(st->metadata, key, NULL, 0);
1580.         if (tag) {
                  ^
1581.             if (!val || !strcmp(tag->value, val + 1))
1582.                 ret = 1;

cmdutils.c:1581:18: Taking false branch
1579.         tag = av_dict_get(st->metadata, key, NULL, 0);
1580.         if (tag) {
1581.             if (!val || !strcmp(tag->value, val + 1))
                       ^
1582.                 ret = 1;
1583.             else

cmdutils.c:1581:26: Taking false branch
1579.         tag = av_dict_get(st->metadata, key, NULL, 0);
1580.         if (tag) {
1581.             if (!val || !strcmp(tag->value, val + 1))
                               ^
1582.                 ret = 1;
1583.             else

cmdutils.c:1584:17: 
1582.                 ret = 1;
1583.             else
1584.                 ret = 0;
                      ^
1585.         } else
1586.             ret = 0;

cmdutils.c:1588:9: Skipping av_freep(): empty list of specs
1586.             ret = 0;
1587. 
1588.         av_freep(&key);
              ^
1589.         return ret;
1590.     } else if (!*spec) /* empty specifier, matches everything */
