libavformat/utils.c:475: error: Memory Leak
  memory dynamically allocated by call to `av_realloc()` at line 460, column 23 is not reachable after line 475, column 13.

libavformat/utils.c:452:1: start of procedure probe_codec()
450. /*******************************************************/
451. 
452. static void probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt)
     ^
453. {
454.     if(st->codec->codec_id == AV_CODEC_ID_PROBE){

libavformat/utils.c:454:8: Taking true branch
452. static void probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt)
453. {
454.     if(st->codec->codec_id == AV_CODEC_ID_PROBE){
            ^
455.         AVProbeData *pd = &st->probe_data;
456.         av_log(s, AV_LOG_DEBUG, "probing stream %d\n", st->index);

libavformat/utils.c:455:9: 
453. {
454.     if(st->codec->codec_id == AV_CODEC_ID_PROBE){
455.         AVProbeData *pd = &st->probe_data;
             ^
456.         av_log(s, AV_LOG_DEBUG, "probing stream %d\n", st->index);
457.         --st->probe_packets;

libavformat/utils.c:456:9: Skipping av_log(): empty list of specs
454.     if(st->codec->codec_id == AV_CODEC_ID_PROBE){
455.         AVProbeData *pd = &st->probe_data;
456.         av_log(s, AV_LOG_DEBUG, "probing stream %d\n", st->index);
             ^
457.         --st->probe_packets;
458. 

libavformat/utils.c:457:9: 
455.         AVProbeData *pd = &st->probe_data;
456.         av_log(s, AV_LOG_DEBUG, "probing stream %d\n", st->index);
457.         --st->probe_packets;
             ^
458. 
459.         if (pkt) {

libavformat/utils.c:459:13: Taking true branch
457.         --st->probe_packets;
458. 
459.         if (pkt) {
                 ^
460.             pd->buf = av_realloc(pd->buf, pd->buf_size+pkt->size+AVPROBE_PADDING_SIZE);
461.             memcpy(pd->buf+pd->buf_size, pkt->data, pkt->size);

libavformat/utils.c:460:13: 
458. 
459.         if (pkt) {
460.             pd->buf = av_realloc(pd->buf, pd->buf_size+pkt->size+AVPROBE_PADDING_SIZE);
                 ^
461.             memcpy(pd->buf+pd->buf_size, pkt->data, pkt->size);
462.             pd->buf_size += pkt->size;

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

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

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

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

libavformat/utils.c:461:13: 
459.         if (pkt) {
460.             pd->buf = av_realloc(pd->buf, pd->buf_size+pkt->size+AVPROBE_PADDING_SIZE);
461.             memcpy(pd->buf+pd->buf_size, pkt->data, pkt->size);
                 ^
462.             pd->buf_size += pkt->size;
463.             memset(pd->buf+pd->buf_size, 0, AVPROBE_PADDING_SIZE);

libavformat/utils.c:462:13: 
460.             pd->buf = av_realloc(pd->buf, pd->buf_size+pkt->size+AVPROBE_PADDING_SIZE);
461.             memcpy(pd->buf+pd->buf_size, pkt->data, pkt->size);
462.             pd->buf_size += pkt->size;
                 ^
463.             memset(pd->buf+pd->buf_size, 0, AVPROBE_PADDING_SIZE);
464.         } else {

libavformat/utils.c:463:13: 
461.             memcpy(pd->buf+pd->buf_size, pkt->data, pkt->size);
462.             pd->buf_size += pkt->size;
463.             memset(pd->buf+pd->buf_size, 0, AVPROBE_PADDING_SIZE);
                 ^
464.         } else {
465.             st->probe_packets = 0;

libavformat/utils.c:473:14: Taking false branch
471.         }
472. 
473.         if (!st->probe_packets ||
                  ^
474.             av_log2(pd->buf_size) != av_log2(pd->buf_size - pkt->size)) {
475.             set_codec_from_probe_data(s, st, pd, st->probe_packets > 0 ? AVPROBE_SCORE_MAX/4 : 0);

libavformat/utils.c:474:13: Taking true branch
472. 
473.         if (!st->probe_packets ||
474.             av_log2(pd->buf_size) != av_log2(pd->buf_size - pkt->size)) {
                 ^
475.             set_codec_from_probe_data(s, st, pd, st->probe_packets > 0 ? AVPROBE_SCORE_MAX/4 : 0);
476.             if(st->codec->codec_id != AV_CODEC_ID_PROBE){

libavformat/utils.c:475:50: Condition is false
473.         if (!st->probe_packets ||
474.             av_log2(pd->buf_size) != av_log2(pd->buf_size - pkt->size)) {
475.             set_codec_from_probe_data(s, st, pd, st->probe_packets > 0 ? AVPROBE_SCORE_MAX/4 : 0);
                                                      ^
476.             if(st->codec->codec_id != AV_CODEC_ID_PROBE){
477.                 pd->buf_size=0;

libavformat/utils.c:475:13: Skipping set_codec_from_probe_data(): empty list of specs
473.         if (!st->probe_packets ||
474.             av_log2(pd->buf_size) != av_log2(pd->buf_size - pkt->size)) {
475.             set_codec_from_probe_data(s, st, pd, st->probe_packets > 0 ? AVPROBE_SCORE_MAX/4 : 0);
                 ^
476.             if(st->codec->codec_id != AV_CODEC_ID_PROBE){
477.                 pd->buf_size=0;

static void probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt)
{
    if(st->codec->codec_id == AV_CODEC_ID_PROBE){
        AVProbeData *pd = &st->probe_data;
        av_log(s, AV_LOG_DEBUG, "probing stream %d\n", st->index);
        --st->probe_packets;
        if (pkt) {
            pd->buf = av_realloc(pd->buf, pd->buf_size+pkt->size+AVPROBE_PADDING_SIZE);
            memcpy(pd->buf+pd->buf_size, pkt->data, pkt->size);
            pd->buf_size += pkt->size;
            memset(pd->buf+pd->buf_size, 0, AVPROBE_PADDING_SIZE);
        } else {
            st->probe_packets = 0;
            if (!pd->buf_size) {
                av_log(s, AV_LOG_ERROR, "nothing to probe for stream %d\n",
                       st->index);
                return;
            }
        }
        if (!st->probe_packets ||
            av_log2(pd->buf_size) != av_log2(pd->buf_size - pkt->size)) {
            set_codec_from_probe_data(s, st, pd, st->probe_packets > 0 ? AVPROBE_SCORE_MAX/4 : 0);
            if(st->codec->codec_id != AV_CODEC_ID_PROBE){
                pd->buf_size=0;
                av_freep(&pd->buf);
                av_log(s, AV_LOG_DEBUG, "probed stream %d\n", st->index);
            }
        }
    }
}
['static void probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt)\n{\n    if(st->codec->codec_id == AV_CODEC_ID_PROBE){\n        AVProbeData *pd = &st->probe_data;\n        av_log(s, AV_LOG_DEBUG, "probing stream %d\\n", st->index);\n        --st->probe_packets;\n        if (pkt) {\n            pd->buf = av_realloc(pd->buf, pd->buf_size+pkt->size+AVPROBE_PADDING_SIZE);\n            memcpy(pd->buf+pd->buf_size, pkt->data, pkt->size);\n            pd->buf_size += pkt->size;\n            memset(pd->buf+pd->buf_size, 0, AVPROBE_PADDING_SIZE);\n        } else {\n            st->probe_packets = 0;\n            if (!pd->buf_size) {\n                av_log(s, AV_LOG_ERROR, "nothing to probe for stream %d\\n",\n                       st->index);\n                return;\n            }\n        }\n        if (!st->probe_packets ||\n            av_log2(pd->buf_size) != av_log2(pd->buf_size - pkt->size)) {\n            set_codec_from_probe_data(s, st, pd, st->probe_packets > 0 ? AVPROBE_SCORE_MAX/4 : 0);\n            if(st->codec->codec_id != AV_CODEC_ID_PROBE){\n                pd->buf_size=0;\n                av_freep(&pd->buf);\n                av_log(s, AV_LOG_DEBUG, "probed stream %d\\n", st->index);\n            }\n        }\n    }\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}']