avtools/avconv_hw.c:74: error: Null Dereference
  pointer `type_name` last assigned on line 70 could be null and is dereferenced by call to `strlen()` at line 74, column 17.

avtools/avconv_hw.c:65:1: start of procedure hw_device_default_name()
63. }
64. 
65. static char *hw_device_default_name(enum AVHWDeviceType type)
    ^
66. {
67.     // Make an automatic name of the form "type%d".  We arbitrarily

avtools/avconv_hw.c:70:5: 
68.     // limit at 1000 anonymous devices of the same type - there is
69.     // probably something else very wrong if you get to this limit.
70.     const char *type_name = av_hwdevice_get_type_name(type);
        ^
71.     char *name;
72.     size_t index_pos;

libavutil/hwcontext.c:72:1: start of procedure av_hwdevice_get_type_name()
  70. }
  71. 
  72. const char *av_hwdevice_get_type_name(enum AVHWDeviceType type)
      ^
  73. {
  74.     if (type > AV_HWDEVICE_TYPE_NONE &&

libavutil/hwcontext.c:74:9: Taking true branch
  72. const char *av_hwdevice_get_type_name(enum AVHWDeviceType type)
  73. {
  74.     if (type > AV_HWDEVICE_TYPE_NONE &&
              ^
  75.         type < FF_ARRAY_ELEMS(hw_type_names))
  76.         return hw_type_names[type];

libavutil/hwcontext.c:75:9: Taking false branch
  73. {
  74.     if (type > AV_HWDEVICE_TYPE_NONE &&
  75.         type < FF_ARRAY_ELEMS(hw_type_names))
              ^
  76.         return hw_type_names[type];
  77.     else

libavutil/hwcontext.c:78:9: 
  76.         return hw_type_names[type];
  77.     else
  78.         return NULL;
              ^
  79. }
  80. 

libavutil/hwcontext.c:79:1: return from a call to av_hwdevice_get_type_name
  77.     else
  78.         return NULL;
  79. }
      ^
  80. 
  81. enum AVHWDeviceType av_hwdevice_iterate_types(enum AVHWDeviceType prev)

avtools/avconv_hw.c:73:5: 
71.     char *name;
72.     size_t index_pos;
73.     int index, index_limit = 1000;
        ^
74.     index_pos = strlen(type_name);
75.     name = av_malloc(index_pos + 4);

avtools/avconv_hw.c:74:5: 
72.     size_t index_pos;
73.     int index, index_limit = 1000;
74.     index_pos = strlen(type_name);
        ^
75.     name = av_malloc(index_pos + 4);
76.     if (!name)

static char *hw_device_default_name(enum AVHWDeviceType type)
{
    const char *type_name = av_hwdevice_get_type_name(type);
    char *name;
    size_t index_pos;
    int index, index_limit = 1000;
    index_pos = strlen(type_name);
    name = av_malloc(index_pos + 4);
    if (!name)
        return NULL;
    for (index = 0; index < index_limit; index++) {
        snprintf(name, index_pos + 4, "%s%d", type_name, index);
        if (!hw_device_get_by_name(name))
            break;
    }
    if (index >= index_limit) {
        av_freep(&name);
        return NULL;
    }
    return name;
}
['static char *hw_device_default_name(enum AVHWDeviceType type)\n{\n    const char *type_name = av_hwdevice_get_type_name(type);\n    char *name;\n    size_t index_pos;\n    int index, index_limit = 1000;\n    index_pos = strlen(type_name);\n    name = av_malloc(index_pos + 4);\n    if (!name)\n        return NULL;\n    for (index = 0; index < index_limit; index++) {\n        snprintf(name, index_pos + 4, "%s%d", type_name, index);\n        if (!hw_device_get_by_name(name))\n            break;\n    }\n    if (index >= index_limit) {\n        av_freep(&name);\n        return NULL;\n    }\n    return name;\n}', 'const char *av_hwdevice_get_type_name(enum AVHWDeviceType type)\n{\n    if (type > AV_HWDEVICE_TYPE_NONE &&\n        type < FF_ARRAY_ELEMS(hw_type_names))\n        return hw_type_names[type];\n    else\n        return NULL;\n}']