libavutil/mem.c:139: error: Memory Leak
  memory dynamically allocated by call to `av_realloc()` at line 130, column 11 is not reachable after line 139, column 1.

libavutil/mem.c:120:1: start of procedure av_reallocp()
118. }
119. 
120. int av_reallocp(void *ptr, size_t size)
     ^
121. {
122.     void *val;

libavutil/mem.c:124:10: Taking false branch
122.     void *val;
123. 
124.     if (!size) {
              ^
125.         av_freep(ptr);
126.         return 0;

libavutil/mem.c:129:5: 
127.     }
128. 
129.     memcpy(&val, ptr, sizeof(val));
         ^
130.     val = av_realloc(val, size);
131. 

libavutil/mem.c:130:5: 
128. 
129.     memcpy(&val, ptr, sizeof(val));
130.     val = av_realloc(val, size);
         ^
131. 
132.     if (!val) {

libavutil/mem.c:107:1: start of procedure av_realloc()
  105. }
  106. 
  107. void *av_realloc(void *ptr, size_t size)
       ^
  108. {
  109.     /* let's disallow possibly ambiguous cases */

libavutil/mem.c:110:9: Taking false branch
  108. {
  109.     /* let's disallow possibly ambiguous cases */
  110.     if (size > (INT_MAX - 16))
               ^
  111.         return NULL;
  112. 

libavutil/mem.c:116:5: 
  114.     return _aligned_realloc(ptr, size, 32);
  115. #else
  116.     return realloc(ptr, size);
           ^
  117. #endif
  118. }

libavutil/mem.c:118:1: return from a call to av_realloc
  116.     return realloc(ptr, size);
  117. #endif
  118. }
       ^
  119. 
  120. int av_reallocp(void *ptr, size_t size)

libavutil/mem.c:132:10: Taking false branch
130.     val = av_realloc(val, size);
131. 
132.     if (!val) {
              ^
133.         av_freep(ptr);
134.         return AVERROR(ENOMEM);

libavutil/mem.c:137:5: 
135.     }
136. 
137.     memcpy(ptr, &val, sizeof(val));
         ^
138.     return 0;
139. }

libavutil/mem.c:138:5: 
136. 
137.     memcpy(ptr, &val, sizeof(val));
138.     return 0;
         ^
139. }
140. 

libavutil/mem.c:139:1: return from a call to av_reallocp
137.     memcpy(ptr, &val, sizeof(val));
138.     return 0;
139. }
     ^
140. 
141. void *av_realloc_array(void *ptr, size_t nmemb, size_t size)

int av_reallocp(void *ptr, size_t size)
{
    void *val;
    if (!size) {
        av_freep(ptr);
        return 0;
    }
    memcpy(&val, ptr, sizeof(val));
    val = av_realloc(val, size);
    if (!val) {
        av_freep(ptr);
        return AVERROR(ENOMEM);
    }
    memcpy(ptr, &val, sizeof(val));
    return 0;
}
['int av_reallocp(void *ptr, size_t size)\n{\n    void *val;\n    if (!size) {\n        av_freep(ptr);\n        return 0;\n    }\n    memcpy(&val, ptr, sizeof(val));\n    val = av_realloc(val, size);\n    if (!val) {\n        av_freep(ptr);\n        return AVERROR(ENOMEM);\n    }\n    memcpy(ptr, &val, sizeof(val));\n    return 0;\n}', 'void *av_realloc(void *ptr, size_t size)\n{\n    if (size > (INT_MAX - 16))\n        return NULL;\n#if HAVE_ALIGNED_MALLOC\n    return _aligned_realloc(ptr, size, 32);\n#else\n    return realloc(ptr, size);\n#endif\n}']