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

avtools/avconv_hw.c:401:16: 
399.         av_log(ist->dec_ctx, AV_LOG_ERROR, "No device available "
400.                "for decoder: device type %s needed for codec %s.\n",
401.                av_hwdevice_get_type_name(type), ist->dec->name);
                    ^
402.         return err;
403.     }

int hw_device_setup_for_decode(InputStream *ist)
{
    const AVCodecHWConfig *config;
    enum AVHWDeviceType type;
    HWDevice *dev = NULL;
    int err, auto_device = 0;
    if (ist->hwaccel_device) {
        dev = hw_device_get_by_name(ist->hwaccel_device);
        if (!dev) {
            if (ist->hwaccel_id == HWACCEL_AUTO) {
                auto_device = 1;
            } else if (ist->hwaccel_id == HWACCEL_GENERIC) {
                type = ist->hwaccel_device_type;
                err = hw_device_init_from_type(type, ist->hwaccel_device,
                                               &dev);
            } else {
                return 0;
            }
        } else {
            if (ist->hwaccel_id == HWACCEL_AUTO) {
                ist->hwaccel_device_type = dev->type;
            } else if (ist->hwaccel_device_type != dev->type) {
                av_log(ist->dec_ctx, AV_LOG_ERROR, "Invalid hwaccel device "
                       "specified for decoder: device %s of type %s is not "
                       "usable with hwaccel %s.\n", dev->name,
                       av_hwdevice_get_type_name(dev->type),
                       av_hwdevice_get_type_name(ist->hwaccel_device_type));
                return AVERROR(EINVAL);
            }
        }
    } else {
        if (ist->hwaccel_id == HWACCEL_AUTO) {
            auto_device = 1;
        } else if (ist->hwaccel_id == HWACCEL_GENERIC) {
            type = ist->hwaccel_device_type;
            dev = hw_device_get_by_type(type);
            if (!dev)
                err = hw_device_init_from_type(type, NULL, &dev);
        } else {
            dev = hw_device_match_by_codec(ist->dec);
            if (!dev) {
                return 0;
            }
        }
    }
    if (auto_device) {
        int i;
        if (!avcodec_get_hw_config(ist->dec, 0)) {
            return 0;
        }
        for (i = 0; !dev; i++) {
            config = avcodec_get_hw_config(ist->dec, i);
            if (!config)
                break;
            type = config->device_type;
            dev = hw_device_get_by_type(type);
            if (dev) {
                av_log(ist->dec_ctx, AV_LOG_INFO, "Using auto "
                       "hwaccel type %s with existing device %s.\n",
                       av_hwdevice_get_type_name(type), dev->name);
            }
        }
        for (i = 0; !dev; i++) {
            config = avcodec_get_hw_config(ist->dec, i);
            if (!config)
                break;
            type = config->device_type;
            err = hw_device_init_from_type(type, ist->hwaccel_device,
                                           &dev);
            if (err < 0) {
                continue;
            }
            if (ist->hwaccel_device) {
                av_log(ist->dec_ctx, AV_LOG_INFO, "Using auto "
                       "hwaccel type %s with new device created "
                       "from %s.\n", av_hwdevice_get_type_name(type),
                       ist->hwaccel_device);
            } else {
                av_log(ist->dec_ctx, AV_LOG_INFO, "Using auto "
                       "hwaccel type %s with new default device.\n",
                       av_hwdevice_get_type_name(type));
            }
        }
        if (dev) {
            ist->hwaccel_device_type = type;
        } else {
            av_log(ist->dec_ctx, AV_LOG_INFO, "Auto hwaccel "
                   "disabled: no device found.\n");
            ist->hwaccel_id = HWACCEL_NONE;
            return 0;
        }
    }
    if (!dev) {
        av_log(ist->dec_ctx, AV_LOG_ERROR, "No device available "
               "for decoder: device type %s needed for codec %s.\n",
               av_hwdevice_get_type_name(type), ist->dec->name);
        return err;
    }
    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    const AVCodecHWConfig *config;\n    enum AVHWDeviceType type;\n    HWDevice *dev = NULL;\n    int err, auto_device = 0;\n    if (ist->hwaccel_device) {\n        dev = hw_device_get_by_name(ist->hwaccel_device);\n        if (!dev) {\n            if (ist->hwaccel_id == HWACCEL_AUTO) {\n                auto_device = 1;\n            } else if (ist->hwaccel_id == HWACCEL_GENERIC) {\n                type = ist->hwaccel_device_type;\n                err = hw_device_init_from_type(type, ist->hwaccel_device,\n                                               &dev);\n            } else {\n                return 0;\n            }\n        } else {\n            if (ist->hwaccel_id == HWACCEL_AUTO) {\n                ist->hwaccel_device_type = dev->type;\n            } else if (ist->hwaccel_device_type != dev->type) {\n                av_log(ist->dec_ctx, AV_LOG_ERROR, "Invalid hwaccel device "\n                       "specified for decoder: device %s of type %s is not "\n                       "usable with hwaccel %s.\\n", dev->name,\n                       av_hwdevice_get_type_name(dev->type),\n                       av_hwdevice_get_type_name(ist->hwaccel_device_type));\n                return AVERROR(EINVAL);\n            }\n        }\n    } else {\n        if (ist->hwaccel_id == HWACCEL_AUTO) {\n            auto_device = 1;\n        } else if (ist->hwaccel_id == HWACCEL_GENERIC) {\n            type = ist->hwaccel_device_type;\n            dev = hw_device_get_by_type(type);\n            if (!dev)\n                err = hw_device_init_from_type(type, NULL, &dev);\n        } else {\n            dev = hw_device_match_by_codec(ist->dec);\n            if (!dev) {\n                return 0;\n            }\n        }\n    }\n    if (auto_device) {\n        int i;\n        if (!avcodec_get_hw_config(ist->dec, 0)) {\n            return 0;\n        }\n        for (i = 0; !dev; i++) {\n            config = avcodec_get_hw_config(ist->dec, i);\n            if (!config)\n                break;\n            type = config->device_type;\n            dev = hw_device_get_by_type(type);\n            if (dev) {\n                av_log(ist->dec_ctx, AV_LOG_INFO, "Using auto "\n                       "hwaccel type %s with existing device %s.\\n",\n                       av_hwdevice_get_type_name(type), dev->name);\n            }\n        }\n        for (i = 0; !dev; i++) {\n            config = avcodec_get_hw_config(ist->dec, i);\n            if (!config)\n                break;\n            type = config->device_type;\n            err = hw_device_init_from_type(type, ist->hwaccel_device,\n                                           &dev);\n            if (err < 0) {\n                continue;\n            }\n            if (ist->hwaccel_device) {\n                av_log(ist->dec_ctx, AV_LOG_INFO, "Using auto "\n                       "hwaccel type %s with new device created "\n                       "from %s.\\n", av_hwdevice_get_type_name(type),\n                       ist->hwaccel_device);\n            } else {\n                av_log(ist->dec_ctx, AV_LOG_INFO, "Using auto "\n                       "hwaccel type %s with new default device.\\n",\n                       av_hwdevice_get_type_name(type));\n            }\n        }\n        if (dev) {\n            ist->hwaccel_device_type = type;\n        } else {\n            av_log(ist->dec_ctx, AV_LOG_INFO, "Auto hwaccel "\n                   "disabled: no device found.\\n");\n            ist->hwaccel_id = HWACCEL_NONE;\n            return 0;\n        }\n    }\n    if (!dev) {\n        av_log(ist->dec_ctx, AV_LOG_ERROR, "No device available "\n               "for decoder: device type %s needed for codec %s.\\n",\n               av_hwdevice_get_type_name(type), ist->dec->name);\n        return err;\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}']