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

avtools/avconv_hw.c:252:1: start of procedure hw_device_setup_for_decode()
250. }
251. 
252. int hw_device_setup_for_decode(InputStream *ist)
     ^
253. {
254.     enum AVHWDeviceType type;

avtools/avconv_hw.c:259:9: Taking true branch
257.     int err;
258. 
259.     if (ist->hwaccel_device) {
             ^
260.         dev = hw_device_get_by_name(ist->hwaccel_device);
261.         if (!dev) {

avtools/avconv_hw.c:260:9: 
258. 
259.     if (ist->hwaccel_device) {
260.         dev = hw_device_get_by_name(ist->hwaccel_device);
             ^
261.         if (!dev) {
262.             char *tmp;

avtools/avconv_hw.c:40:1: start of procedure hw_device_get_by_name()
  38. }
  39. 
  40. HWDevice *hw_device_get_by_name(const char *name)
      ^
  41. {
  42.     int i;

avtools/avconv_hw.c:43:10: 
  41. {
  42.     int i;
  43.     for (i = 0; i < nb_hw_devices; i++) {
               ^
  44.         if (!strcmp(hw_devices[i]->name, name))
  45.             return hw_devices[i];

avtools/avconv_hw.c:43:17: Loop condition is true. Entering loop body
  41. {
  42.     int i;
  43.     for (i = 0; i < nb_hw_devices; i++) {
                      ^
  44.         if (!strcmp(hw_devices[i]->name, name))
  45.             return hw_devices[i];

avtools/avconv_hw.c:44:14: Taking false branch
  42.     int i;
  43.     for (i = 0; i < nb_hw_devices; i++) {
  44.         if (!strcmp(hw_devices[i]->name, name))
                   ^
  45.             return hw_devices[i];
  46.     }

avtools/avconv_hw.c:43:36: 
  41. {
  42.     int i;
  43.     for (i = 0; i < nb_hw_devices; i++) {
                                         ^
  44.         if (!strcmp(hw_devices[i]->name, name))
  45.             return hw_devices[i];

avtools/avconv_hw.c:43:17: Loop condition is false. Leaving loop
  41. {
  42.     int i;
  43.     for (i = 0; i < nb_hw_devices; i++) {
                      ^
  44.         if (!strcmp(hw_devices[i]->name, name))
  45.             return hw_devices[i];

avtools/avconv_hw.c:47:5: 
  45.             return hw_devices[i];
  46.     }
  47.     return NULL;
          ^
  48. }
  49. 

avtools/avconv_hw.c:48:1: return from a call to hw_device_get_by_name
  46.     }
  47.     return NULL;
  48. }
      ^
  49. 
  50. static HWDevice *hw_device_add(void)

avtools/avconv_hw.c:261:14: Taking true branch
259.     if (ist->hwaccel_device) {
260.         dev = hw_device_get_by_name(ist->hwaccel_device);
261.         if (!dev) {
                  ^
262.             char *tmp;
263.             size_t len;

avtools/avconv_hw.c:264:13: 
262.             char *tmp;
263.             size_t len;
264.             type = hw_device_match_type_by_hwaccel(ist->hwaccel_id);
                 ^
265.             if (type == AV_HWDEVICE_TYPE_NONE) {
266.                 // No match - this isn't necessarily invalid, though,

avtools/avconv_hw.c:226:1: start of procedure hw_device_match_type_by_hwaccel()
  224. }
  225. 
  226. static enum AVHWDeviceType hw_device_match_type_by_hwaccel(enum HWAccelID hwaccel_id)
       ^
  227. {
  228.     int i;

avtools/avconv_hw.c:229:9: Taking false branch
  227. {
  228.     int i;
  229.     if (hwaccel_id == HWACCEL_NONE)
               ^
  230.         return AV_HWDEVICE_TYPE_NONE;
  231.     for (i = 0; hwaccels[i].name; i++) {

avtools/avconv_hw.c:231:10: 
  229.     if (hwaccel_id == HWACCEL_NONE)
  230.         return AV_HWDEVICE_TYPE_NONE;
  231.     for (i = 0; hwaccels[i].name; i++) {
                ^
  232.         if (hwaccels[i].id == hwaccel_id)
  233.             return hwaccels[i].device_type;

avtools/avconv_hw.c:231:17: Loop condition is true. Entering loop body
  229.     if (hwaccel_id == HWACCEL_NONE)
  230.         return AV_HWDEVICE_TYPE_NONE;
  231.     for (i = 0; hwaccels[i].name; i++) {
                       ^
  232.         if (hwaccels[i].id == hwaccel_id)
  233.             return hwaccels[i].device_type;

avtools/avconv_hw.c:232:13: Taking false branch
  230.         return AV_HWDEVICE_TYPE_NONE;
  231.     for (i = 0; hwaccels[i].name; i++) {
  232.         if (hwaccels[i].id == hwaccel_id)
                   ^
  233.             return hwaccels[i].device_type;
  234.     }

avtools/avconv_hw.c:231:35: 
  229.     if (hwaccel_id == HWACCEL_NONE)
  230.         return AV_HWDEVICE_TYPE_NONE;
  231.     for (i = 0; hwaccels[i].name; i++) {
                                         ^
  232.         if (hwaccels[i].id == hwaccel_id)
  233.             return hwaccels[i].device_type;

avtools/avconv_hw.c:231:17: Loop condition is true. Entering loop body
  229.     if (hwaccel_id == HWACCEL_NONE)
  230.         return AV_HWDEVICE_TYPE_NONE;
  231.     for (i = 0; hwaccels[i].name; i++) {
                       ^
  232.         if (hwaccels[i].id == hwaccel_id)
  233.             return hwaccels[i].device_type;

avtools/avconv_hw.c:232:13: Taking false branch
  230.         return AV_HWDEVICE_TYPE_NONE;
  231.     for (i = 0; hwaccels[i].name; i++) {
  232.         if (hwaccels[i].id == hwaccel_id)
                   ^
  233.             return hwaccels[i].device_type;
  234.     }

avtools/avconv_hw.c:231:35: 
  229.     if (hwaccel_id == HWACCEL_NONE)
  230.         return AV_HWDEVICE_TYPE_NONE;
  231.     for (i = 0; hwaccels[i].name; i++) {
                                         ^
  232.         if (hwaccels[i].id == hwaccel_id)
  233.             return hwaccels[i].device_type;

avtools/avconv_hw.c:231:17: Loop condition is true. Entering loop body
  229.     if (hwaccel_id == HWACCEL_NONE)
  230.         return AV_HWDEVICE_TYPE_NONE;
  231.     for (i = 0; hwaccels[i].name; i++) {
                       ^
  232.         if (hwaccels[i].id == hwaccel_id)
  233.             return hwaccels[i].device_type;

avtools/avconv_hw.c:232:13: Taking true branch
  230.         return AV_HWDEVICE_TYPE_NONE;
  231.     for (i = 0; hwaccels[i].name; i++) {
  232.         if (hwaccels[i].id == hwaccel_id)
                   ^
  233.             return hwaccels[i].device_type;
  234.     }

avtools/avconv_hw.c:233:13: 
  231.     for (i = 0; hwaccels[i].name; i++) {
  232.         if (hwaccels[i].id == hwaccel_id)
  233.             return hwaccels[i].device_type;
                   ^
  234.     }
  235.     return AV_HWDEVICE_TYPE_NONE;

avtools/avconv_hw.c:236:1: return from a call to hw_device_match_type_by_hwaccel
  234.     }
  235.     return AV_HWDEVICE_TYPE_NONE;
  236. }
       ^
  237. 
  238. static enum AVHWDeviceType hw_device_match_type_in_name(const char *codec_name)

avtools/avconv_hw.c:265:17: Taking false branch
263.             size_t len;
264.             type = hw_device_match_type_by_hwaccel(ist->hwaccel_id);
265.             if (type == AV_HWDEVICE_TYPE_NONE) {
                     ^
266.                 // No match - this isn't necessarily invalid, though,
267.                 // because an explicit device might not be needed or

avtools/avconv_hw.c:271:13: 
269.                 return 0;
270.             }
271.             type_name = av_hwdevice_get_type_name(type);
                 ^
272.             len = strlen(type_name) + 1 +
273.                   strlen(ist->hwaccel_device) + 1;

libavutil/hwcontext.c:68:1: start of procedure av_hwdevice_get_type_name()
  66. }
  67. 
  68. const char *av_hwdevice_get_type_name(enum AVHWDeviceType type)
      ^
  69. {
  70.     if (type >= 0 && type < FF_ARRAY_ELEMS(hw_type_names))

libavutil/hwcontext.c:70:9: Taking true branch
  68. const char *av_hwdevice_get_type_name(enum AVHWDeviceType type)
  69. {
  70.     if (type >= 0 && type < FF_ARRAY_ELEMS(hw_type_names))
              ^
  71.         return hw_type_names[type];
  72.     else

libavutil/hwcontext.c:70:22: Taking false branch
  68. const char *av_hwdevice_get_type_name(enum AVHWDeviceType type)
  69. {
  70.     if (type >= 0 && type < FF_ARRAY_ELEMS(hw_type_names))
                           ^
  71.         return hw_type_names[type];
  72.     else

libavutil/hwcontext.c:73:9: 
  71.         return hw_type_names[type];
  72.     else
  73.         return NULL;
              ^
  74. }
  75. 

libavutil/hwcontext.c:74:1: return from a call to av_hwdevice_get_type_name
  72.     else
  73.         return NULL;
  74. }
      ^
  75. 
  76. enum AVHWDeviceType av_hwdevice_iterate_types(enum AVHWDeviceType prev)

avtools/avconv_hw.c:272:13: 
270.             }
271.             type_name = av_hwdevice_get_type_name(type);
272.             len = strlen(type_name) + 1 +
                 ^
273.                   strlen(ist->hwaccel_device) + 1;
274.             tmp = av_malloc(len);
