diff --git a/ffmpeg_vdpau.c b/ffmpeg_vdpau.c index 59a5f70121..cf2e83e8a3 100644 --- a/ffmpeg_vdpau.c +++ b/ffmpeg_vdpau.c @@ -126,8 +126,10 @@ static int vdpau_alloc(AVCodecContext *s) return AVERROR(ENOMEM); device_priv = av_mallocz(sizeof(*device_priv)); - if (!device_priv) + if (!device_priv) { + av_freep(&ctx); goto fail; + } ist->hwaccel_ctx = ctx; ist->hwaccel_uninit = vdpau_uninit;