[vlc-commits] vdpau: missing error case handling

Rémi Denis-Courmont git at videolan.org
Tue Jul 9 21:04:27 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jul  9 22:03:35 2013 +0300| [e859d6a24730b22e01994891f75423b15f76dcc9] | committer: Rémi Denis-Courmont

vdpau: missing error case handling

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

 modules/hw/vdpau/chroma.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/modules/hw/vdpau/chroma.c b/modules/hw/vdpau/chroma.c
index f4c311e..867dd10 100644
--- a/modules/hw/vdpau/chroma.c
+++ b/modules/hw/vdpau/chroma.c
@@ -474,10 +474,15 @@ static picture_t *MixerRender(filter_t *filter, picture_t *src)
     src = sys->import(filter, src);
 
     /* Update history and take "present" picture field */
-    sys->history[MAX_PAST + MAX_FUTURE].field = vlc_vdp_video_detach(src);
-    sys->history[MAX_PAST + MAX_FUTURE].date = src->date;
-    sys->history[MAX_PAST + MAX_FUTURE].force = src->b_force;
-    picture_Release(src);
+    if (likely(src != NULL))
+    {
+        sys->history[MAX_PAST + MAX_FUTURE].field = vlc_vdp_video_detach(src);
+        sys->history[MAX_PAST + MAX_FUTURE].date = src->date;
+        sys->history[MAX_PAST + MAX_FUTURE].force = src->b_force;
+        picture_Release(src);
+    }
+    else
+        sys->history[MAX_PAST + MAX_FUTURE].field = NULL;
 
     vlc_vdp_video_field_t *f = sys->history[MAX_PAST].field;
     if (f == NULL)



More information about the vlc-commits mailing list