[FFmpeg-cvslog] ffmpeg_vdpau: Free ctx on error path

Michael Niedermayer git at videolan.org
Thu Mar 3 16:41:56 CET 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Mar  3 15:48:17 2016 +0100| [ba687ae0bdd168332261853a965576bc78c4f7e0] | committer: Michael Niedermayer

ffmpeg_vdpau: Free ctx on error path

Fixes CID1355118

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ba687ae0bdd168332261853a965576bc78c4f7e0
---

 ffmpeg_vdpau.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ffmpeg_vdpau.c b/ffmpeg_vdpau.c
index 59a5f70..cf2e83e 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;



More information about the ffmpeg-cvslog mailing list