]> git.sesse.net Git - ffmpeg/commitdiff
ffmpeg_vdpau: Free ctx on error path
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 3 Mar 2016 14:48:17 +0000 (15:48 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 3 Mar 2016 15:41:11 +0000 (16:41 +0100)
Fixes CID1355118

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
ffmpeg_vdpau.c

index 59a5f701213f01333e93a7f39bf798e60a6ab313..cf2e83e8a3f58cacae643cf316409227f9cd2cb3 100644 (file)
@@ -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;