[vlc-commits] vdpau/chroma: fix leak on error

Rémi Denis-Courmont git at videolan.org
Sat Jun 7 18:28:02 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jun  7 17:03:07 2014 +0300| [1d20c49533b7579620607bbb4f0b7f2a122e9a56] | committer: Rémi Denis-Courmont

vdpau/chroma: fix leak on error

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1d20c49533b7579620607bbb4f0b7f2a122e9a56
---

 modules/hw/vdpau/chroma.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/hw/vdpau/chroma.c b/modules/hw/vdpau/chroma.c
index fa63676..947bdcd 100644
--- a/modules/hw/vdpau/chroma.c
+++ b/modules/hw/vdpau/chroma.c
@@ -428,7 +428,7 @@ static picture_t *VideoPassthrough(filter_t *filter, picture_t *src)
     if (unlikely(field == NULL))
     {
         msg_Err(filter, "corrupt VDPAU video surface");
-        return NULL;
+        goto error;
     }
 
     vlc_vdp_video_frame_t *psys = field->frame;
@@ -447,7 +447,7 @@ static picture_t *VideoPassthrough(filter_t *filter, picture_t *src)
 
         picture_t *pic = picture_NewFromFormat(&fmt);
         if (unlikely(pic == NULL))
-            return NULL;
+            goto error;
 
         pic = VideoExport(filter, src, pic);
         if (pic == NULL)
@@ -456,6 +456,9 @@ static picture_t *VideoPassthrough(filter_t *filter, picture_t *src)
         src = VideoImport(filter, pic);
     }
     return src;
+error:
+    picture_Release(src);
+    return NULL;
 }
 
 static inline VdpVideoSurface picture_GetVideoSurface(const picture_t *pic)



More information about the vlc-commits mailing list