mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 05:45:58 +00:00
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@intel.com>
This commit is contained in:
parent
deff9c775c
commit
0e8afe1c22
2 changed files with 3 additions and 3 deletions
|
@ -394,7 +394,7 @@ pop_frame(GstVaapiDecoder *decoder, guint64 timeout)
|
||||||
|
|
||||||
proxy = frame->user_data;
|
proxy = frame->user_data;
|
||||||
GST_DEBUG("dequeue decoded surface %" GST_VAAPI_ID_FORMAT,
|
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;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,8 +239,8 @@ gst_vaapi_surface_proxy_get_flags(GstVaapiSurfaceProxy *proxy)
|
||||||
GstVaapiID
|
GstVaapiID
|
||||||
gst_vaapi_surface_proxy_get_surface_id(GstVaapiSurfaceProxy *proxy)
|
gst_vaapi_surface_proxy_get_surface_id(GstVaapiSurfaceProxy *proxy)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail(proxy != NULL, 0);
|
g_return_val_if_fail(proxy != NULL, VA_INVALID_ID);
|
||||||
g_return_val_if_fail(proxy->surface != NULL, 0);
|
g_return_val_if_fail(proxy->surface != NULL, VA_INVALID_ID);
|
||||||
|
|
||||||
return GST_VAAPI_SURFACE_PROXY_SURFACE_ID(proxy);
|
return GST_VAAPI_SURFACE_PROXY_SURFACE_ID(proxy);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue