libavfilter/vf_hwmap.c:193: error: Uninitialized Value
  The value read from err was never initialized.

libavfilter/vf_hwmap.c:193:5: 
191. fail:
192.     av_buffer_unref(&ctx->hwframes_ref);
193.     return err;
         ^
194. }
195. 

static int hwmap_config_output(AVFilterLink *outlink)
{
    AVFilterContext *avctx = outlink->src;
    HWMapContext      *ctx = avctx->priv;
    AVFilterLink   *inlink = avctx->inputs[0];
    AVHWFramesContext *hwfc;
    AVBufferRef *device;
    const AVPixFmtDescriptor *desc;
    int err;
    av_log(avctx, AV_LOG_DEBUG, "Configure hwmap %s -> %s.\n",
           av_get_pix_fmt_name(inlink->format),
           av_get_pix_fmt_name(outlink->format));
    av_buffer_unref(&ctx->hwframes_ref);
    device = avctx->hw_device_ctx;
    if (inlink->hw_frames_ctx) {
        hwfc = (AVHWFramesContext*)inlink->hw_frames_ctx->data;
        if (ctx->derive_device_type) {
            enum AVHWDeviceType type;
            type = av_hwdevice_find_type_by_name(ctx->derive_device_type);
            if (type == AV_HWDEVICE_TYPE_NONE) {
                av_log(avctx, AV_LOG_ERROR, "Invalid device type.\n");
                goto fail;
            }
            err = av_hwdevice_ctx_create_derived(&device, type,
                                                 hwfc->device_ref, 0);
            if (err < 0) {
                av_log(avctx, AV_LOG_ERROR, "Failed to created derived "
                       "device context: %d.\n", err);
                goto fail;
            }
        }
        desc = av_pix_fmt_desc_get(outlink->format);
        if (!desc) {
            err = AVERROR(EINVAL);
            goto fail;
        }
        if (inlink->format == hwfc->format &&
            (desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) {
            if (!device) {
                av_log(avctx, AV_LOG_ERROR, "A device reference is "
                       "required to map to a hardware format.\n");
                err = AVERROR(EINVAL);
                goto fail;
            }
            err = av_hwframe_ctx_create_derived(&ctx->hwframes_ref,
                                                outlink->format,
                                                device,
                                                inlink->hw_frames_ctx, 0);
            if (err < 0) {
                av_log(avctx, AV_LOG_ERROR, "Failed to create derived "
                       "frames context: %d.\n", err);
                goto fail;
            }
        } else if ((outlink->format == hwfc->format &&
                    inlink->format  == hwfc->sw_format) ||
                   inlink->format == hwfc->format) {
            ctx->hwframes_ref = av_buffer_ref(inlink->hw_frames_ctx);
            if (!ctx->hwframes_ref) {
                err = AVERROR(ENOMEM);
                goto fail;
            }
        } else {
            av_log(avctx, AV_LOG_ERROR, "Unsupported formats for "
                   "hwmap: from %s (%s) to %s.\n",
                   av_get_pix_fmt_name(inlink->format),
                   av_get_pix_fmt_name(hwfc->format),
                   av_get_pix_fmt_name(outlink->format));
            err = AVERROR(EINVAL);
            goto fail;
        }
    } else if (avctx->hw_device_ctx) {
        if (!device) {
            av_log(avctx, AV_LOG_ERROR, "A device reference is "
                   "required to create new frames with backwards "
                   "mapping.\n");
            err = AVERROR(EINVAL);
            goto fail;
        }
        ctx->map_backwards = 1;
        ctx->hwframes_ref = av_hwframe_ctx_alloc(device);
        if (!ctx->hwframes_ref) {
            err = AVERROR(ENOMEM);
            goto fail;
        }
        hwfc = (AVHWFramesContext*)ctx->hwframes_ref->data;
        hwfc->format    = outlink->format;
        hwfc->sw_format = inlink->format;
        hwfc->width     = inlink->w;
        hwfc->height    = inlink->h;
        err = av_hwframe_ctx_init(ctx->hwframes_ref);
        if (err < 0) {
            av_log(avctx, AV_LOG_ERROR, "Failed to create frame "
                   "context for backward mapping: %d.\n", err);
            goto fail;
        }
    } else {
        av_log(avctx, AV_LOG_ERROR, "Mapping requires a hardware "
               "context (a device, or frames on input).\n");
        return AVERROR(EINVAL);
    }
    outlink->hw_frames_ctx = av_buffer_ref(ctx->hwframes_ref);
    if (!outlink->hw_frames_ctx) {
        err = AVERROR(ENOMEM);
        goto fail;
    }
    outlink->w = inlink->w;
    outlink->h = inlink->h;
    return 0;
fail:
    av_buffer_unref(&ctx->hwframes_ref);
    return err;
}
['static int hwmap_config_output(AVFilterLink *outlink)\n{\n    AVFilterContext *avctx = outlink->src;\n    HWMapContext      *ctx = avctx->priv;\n    AVFilterLink   *inlink = avctx->inputs[0];\n    AVHWFramesContext *hwfc;\n    AVBufferRef *device;\n    const AVPixFmtDescriptor *desc;\n    int err;\n    av_log(avctx, AV_LOG_DEBUG, "Configure hwmap %s -> %s.\\n",\n           av_get_pix_fmt_name(inlink->format),\n           av_get_pix_fmt_name(outlink->format));\n    av_buffer_unref(&ctx->hwframes_ref);\n    device = avctx->hw_device_ctx;\n    if (inlink->hw_frames_ctx) {\n        hwfc = (AVHWFramesContext*)inlink->hw_frames_ctx->data;\n        if (ctx->derive_device_type) {\n            enum AVHWDeviceType type;\n            type = av_hwdevice_find_type_by_name(ctx->derive_device_type);\n            if (type == AV_HWDEVICE_TYPE_NONE) {\n                av_log(avctx, AV_LOG_ERROR, "Invalid device type.\\n");\n                goto fail;\n            }\n            err = av_hwdevice_ctx_create_derived(&device, type,\n                                                 hwfc->device_ref, 0);\n            if (err < 0) {\n                av_log(avctx, AV_LOG_ERROR, "Failed to created derived "\n                       "device context: %d.\\n", err);\n                goto fail;\n            }\n        }\n        desc = av_pix_fmt_desc_get(outlink->format);\n        if (!desc) {\n            err = AVERROR(EINVAL);\n            goto fail;\n        }\n        if (inlink->format == hwfc->format &&\n            (desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) {\n            if (!device) {\n                av_log(avctx, AV_LOG_ERROR, "A device reference is "\n                       "required to map to a hardware format.\\n");\n                err = AVERROR(EINVAL);\n                goto fail;\n            }\n            err = av_hwframe_ctx_create_derived(&ctx->hwframes_ref,\n                                                outlink->format,\n                                                device,\n                                                inlink->hw_frames_ctx, 0);\n            if (err < 0) {\n                av_log(avctx, AV_LOG_ERROR, "Failed to create derived "\n                       "frames context: %d.\\n", err);\n                goto fail;\n            }\n        } else if ((outlink->format == hwfc->format &&\n                    inlink->format  == hwfc->sw_format) ||\n                   inlink->format == hwfc->format) {\n            ctx->hwframes_ref = av_buffer_ref(inlink->hw_frames_ctx);\n            if (!ctx->hwframes_ref) {\n                err = AVERROR(ENOMEM);\n                goto fail;\n            }\n        } else {\n            av_log(avctx, AV_LOG_ERROR, "Unsupported formats for "\n                   "hwmap: from %s (%s) to %s.\\n",\n                   av_get_pix_fmt_name(inlink->format),\n                   av_get_pix_fmt_name(hwfc->format),\n                   av_get_pix_fmt_name(outlink->format));\n            err = AVERROR(EINVAL);\n            goto fail;\n        }\n    } else if (avctx->hw_device_ctx) {\n        if (!device) {\n            av_log(avctx, AV_LOG_ERROR, "A device reference is "\n                   "required to create new frames with backwards "\n                   "mapping.\\n");\n            err = AVERROR(EINVAL);\n            goto fail;\n        }\n        ctx->map_backwards = 1;\n        ctx->hwframes_ref = av_hwframe_ctx_alloc(device);\n        if (!ctx->hwframes_ref) {\n            err = AVERROR(ENOMEM);\n            goto fail;\n        }\n        hwfc = (AVHWFramesContext*)ctx->hwframes_ref->data;\n        hwfc->format    = outlink->format;\n        hwfc->sw_format = inlink->format;\n        hwfc->width     = inlink->w;\n        hwfc->height    = inlink->h;\n        err = av_hwframe_ctx_init(ctx->hwframes_ref);\n        if (err < 0) {\n            av_log(avctx, AV_LOG_ERROR, "Failed to create frame "\n                   "context for backward mapping: %d.\\n", err);\n            goto fail;\n        }\n    } else {\n        av_log(avctx, AV_LOG_ERROR, "Mapping requires a hardware "\n               "context (a device, or frames on input).\\n");\n        return AVERROR(EINVAL);\n    }\n    outlink->hw_frames_ctx = av_buffer_ref(ctx->hwframes_ref);\n    if (!outlink->hw_frames_ctx) {\n        err = AVERROR(ENOMEM);\n        goto fail;\n    }\n    outlink->w = inlink->w;\n    outlink->h = inlink->h;\n    return 0;\nfail:\n    av_buffer_unref(&ctx->hwframes_ref);\n    return err;\n}']