[Pkg-gstreamer-commits] [gstreamer-vaapi] 152/176: decoder: fix crash on invalid pointer for GST_DEBUG().

Vincent Cheng vcheng at moszumanska.debian.org
Tue Jun 3 08:09:36 UTC 2014


This is an automated email from the git hooks/post-receive script.

vcheng pushed a commit to branch upstream
in repository gstreamer-vaapi.

commit 0e8afe1c22d6fe942c3ed452761bae445af3da9c
Author: Wind Yuan <feng.yuan at intel.com>
Date:   Fri Jan 17 16:56:53 2014 +0800

    decoder: fix crash on invalid pointer for GST_DEBUG().
    
    When decoding failed, or that the frame was dropped, the associated
    surface proxy is not guaranteed to be present. Thus, the GST_DEBUG()
    message needs to check whether the proxy is actually present or not.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=722403
    
    [fixed gst_vaapi_surface_proxy_get_surface_id() to return VA_INVALID_ID]
    Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne at intel.com>
---
 gst-libs/gst/vaapi/gstvaapidecoder.c      | 2 +-
 gst-libs/gst/vaapi/gstvaapisurfaceproxy.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gst-libs/gst/vaapi/gstvaapidecoder.c b/gst-libs/gst/vaapi/gstvaapidecoder.c
index 8a8fa4c..8b05f7b 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder.c
@@ -394,7 +394,7 @@ pop_frame(GstVaapiDecoder *decoder, guint64 timeout)
 
     proxy = frame->user_data;
     GST_DEBUG("dequeue decoded surface %" GST_VAAPI_ID_FORMAT,
-              GST_VAAPI_ID_ARGS(GST_VAAPI_SURFACE_PROXY_SURFACE_ID(proxy)));
+              GST_VAAPI_ID_ARGS(gst_vaapi_surface_proxy_get_surface_id(proxy)));
 
     return frame;
 }
diff --git a/gst-libs/gst/vaapi/gstvaapisurfaceproxy.c b/gst-libs/gst/vaapi/gstvaapisurfaceproxy.c
index 82432f0..516cb13 100644
--- a/gst-libs/gst/vaapi/gstvaapisurfaceproxy.c
+++ b/gst-libs/gst/vaapi/gstvaapisurfaceproxy.c
@@ -239,8 +239,8 @@ gst_vaapi_surface_proxy_get_flags(GstVaapiSurfaceProxy *proxy)
 GstVaapiID
 gst_vaapi_surface_proxy_get_surface_id(GstVaapiSurfaceProxy *proxy)
 {
-    g_return_val_if_fail(proxy != NULL, 0);
-    g_return_val_if_fail(proxy->surface != NULL, 0);
+    g_return_val_if_fail(proxy != NULL, VA_INVALID_ID);
+    g_return_val_if_fail(proxy->surface != NULL, VA_INVALID_ID);
 
     return GST_VAAPI_SURFACE_PROXY_SURFACE_ID(proxy);
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gstreamer/gstreamer-vaapi.git



More information about the Pkg-gstreamer-commits mailing list