avtools/avconv_hw.c:299: error: Uninitialized Value
  The value read from type was never initialized.

avtools/avconv_hw.c:299:16: 
297.         av_log(ist->dec_ctx, AV_LOG_WARNING, "No device available "
298.                "for decoder (device type %s for codec %s).\n",
299.                av_hwdevice_get_type_name(type), ist->dec->name);
                    ^
300.         return 0;
301.     }

int hw_device_setup_for_decode(InputStream *ist)
{
    enum AVHWDeviceType type;
    HWDevice *dev;
    const char *type_name;
    int err;
    if (ist->hwaccel_device) {
        dev = hw_device_get_by_name(ist->hwaccel_device);
        if (!dev) {
            char *tmp;
            size_t len;
            type = hw_device_match_type_by_hwaccel(ist->hwaccel_id);
            if (type == AV_HWDEVICE_TYPE_NONE) {
                return 0;
            }
            type_name = av_hwdevice_get_type_name(type);
            len = strlen(type_name) + 1 +
                  strlen(ist->hwaccel_device) + 1;
            tmp = av_malloc(len);
            if (!tmp)
                return AVERROR(ENOMEM);
            snprintf(tmp, len, "%s:%s", type_name, ist->hwaccel_device);
            err = hw_device_init_from_string(tmp, &dev);
            av_free(tmp);
            if (err < 0)
                return err;
        }
    } else {
        if (ist->hwaccel_id != HWACCEL_NONE)
            type = hw_device_match_type_by_hwaccel(ist->hwaccel_id);
        else
            type = hw_device_match_type_in_name(ist->dec->name);
        if (type != AV_HWDEVICE_TYPE_NONE) {
            dev = hw_device_get_by_type(type);
        } else {
            return 0;
        }
    }
    if (!dev) {
        av_log(ist->dec_ctx, AV_LOG_WARNING, "No device available "
               "for decoder (device type %s for codec %s).\n",
               av_hwdevice_get_type_name(type), ist->dec->name);
        return 0;
    }
    ist->dec_ctx->hw_device_ctx = av_buffer_ref(dev->device_ref);
    if (!ist->dec_ctx->hw_device_ctx)
        return AVERROR(ENOMEM);
    return 0;
}
['int hw_device_setup_for_decode(InputStream *ist)\n{\n    enum AVHWDeviceType type;\n    HWDevice *dev;\n    const char *type_name;\n    int err;\n    if (ist->hwaccel_device) {\n        dev = hw_device_get_by_name(ist->hwaccel_device);\n        if (!dev) {\n            char *tmp;\n            size_t len;\n            type = hw_device_match_type_by_hwaccel(ist->hwaccel_id);\n            if (type == AV_HWDEVICE_TYPE_NONE) {\n                return 0;\n            }\n            type_name = av_hwdevice_get_type_name(type);\n            len = strlen(type_name) + 1 +\n                  strlen(ist->hwaccel_device) + 1;\n            tmp = av_malloc(len);\n            if (!tmp)\n                return AVERROR(ENOMEM);\n            snprintf(tmp, len, "%s:%s", type_name, ist->hwaccel_device);\n            err = hw_device_init_from_string(tmp, &dev);\n            av_free(tmp);\n            if (err < 0)\n                return err;\n        }\n    } else {\n        if (ist->hwaccel_id != HWACCEL_NONE)\n            type = hw_device_match_type_by_hwaccel(ist->hwaccel_id);\n        else\n            type = hw_device_match_type_in_name(ist->dec->name);\n        if (type != AV_HWDEVICE_TYPE_NONE) {\n            dev = hw_device_get_by_type(type);\n        } else {\n            return 0;\n        }\n    }\n    if (!dev) {\n        av_log(ist->dec_ctx, AV_LOG_WARNING, "No device available "\n               "for decoder (device type %s for codec %s).\\n",\n               av_hwdevice_get_type_name(type), ist->dec->name);\n        return 0;\n    }\n    ist->dec_ctx->hw_device_ctx = av_buffer_ref(dev->device_ref);\n    if (!ist->dec_ctx->hw_device_ctx)\n        return AVERROR(ENOMEM);\n    return 0;\n}']