avprobe.c:305: error: Null Dereference
  pointer `p` last assigned on line 304 could be null and is dereferenced at line 305, column 12.

avprobe.c:297:1: start of procedure old_print_object_header()
295.  * old-style pseudo-INI
296.  */
297. static void old_print_object_header(const char *name)
     ^
298. {
299.     char *str, *p;

avprobe.c:301:10: Taking false branch
299.     char *str, *p;
300. 
301.     if (!strcmp(name, "tags"))
              ^
302.         return;
303. 

avprobe.c:304:5: 
302.         return;
303. 
304.     str = p = av_strdup(name);
         ^
305.     while (*p) {
306.         *p = av_toupper(*p);

libavutil/mem.c:212:1: start of procedure av_strdup()
  210. }
  211. 
  212. char *av_strdup(const char *s)
       ^
  213. {
  214.     char *ptr = NULL;

libavutil/mem.c:214:5: 
  212. char *av_strdup(const char *s)
  213. {
  214.     char *ptr = NULL;
           ^
  215.     if (s) {
  216.         int len = strlen(s) + 1;

libavutil/mem.c:215:9: Taking true branch
  213. {
  214.     char *ptr = NULL;
  215.     if (s) {
               ^
  216.         int len = strlen(s) + 1;
  217.         ptr = av_realloc(NULL, len);

libavutil/mem.c:216:9: 
  214.     char *ptr = NULL;
  215.     if (s) {
  216.         int len = strlen(s) + 1;
               ^
  217.         ptr = av_realloc(NULL, len);
  218.         if (ptr)

libavutil/mem.c:217:9: 
  215.     if (s) {
  216.         int len = strlen(s) + 1;
  217.         ptr = av_realloc(NULL, len);
               ^
  218.         if (ptr)
  219.             memcpy(ptr, s, len);

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 true branch
    121. 
    122.     /* let's disallow possibly ambiguous cases */
    123.     if (size > (INT_MAX - 16))
                 ^
    124.         return NULL;
    125. 

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

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

libavutil/mem.c:218:13: Taking false branch
  216.         int len = strlen(s) + 1;
  217.         ptr = av_realloc(NULL, len);
  218.         if (ptr)
                   ^
  219.             memcpy(ptr, s, len);
  220.     }

libavutil/mem.c:221:5: 
  219.             memcpy(ptr, s, len);
  220.     }
  221.     return ptr;
           ^
  222. }
  223. 

libavutil/mem.c:222:1: return from a call to av_strdup
  220.     }
  221.     return ptr;
  222. }
       ^
  223. 
  224. static void fill16(uint8_t *dst, int len)

avprobe.c:305:12: Loop condition is false. Leaving loop
303. 
304.     str = p = av_strdup(name);
305.     while (*p) {
                ^
306.         *p = av_toupper(*p);
307.         p++;

static void old_print_object_header(const char *name)
{
    char *str, *p;
    if (!strcmp(name, "tags"))
        return;
    str = p = av_strdup(name);
    while (*p) {
        *p = av_toupper(*p);
        p++;
    }
    avio_printf(probe_out, "[%s]\n", str);
    av_freep(&str);
}
['static void old_print_object_header(const char *name)\n{\n    char *str, *p;\n    if (!strcmp(name, "tags"))\n        return;\n    str = p = av_strdup(name);\n    while (*p) {\n        *p = av_toupper(*p);\n        p++;\n    }\n    avio_printf(probe_out, "[%s]\\n", str);\n    av_freep(&str);\n}', 'char *av_strdup(const char *s)\n{\n    char *ptr = NULL;\n    if (s) {\n        int len = strlen(s) + 1;\n        ptr = av_realloc(NULL, len);\n        if (ptr)\n            memcpy(ptr, s, len);\n    }\n    return ptr;\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}']