From a02c86b39518fd5a9c955f829a86fddff9a0767e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Wed, 9 Nov 2016 18:54:47 +0100 Subject: [PATCH] vaapivideomemory: fail if frame map can't get plane If map() vmethod in GstVideMeta cannot get the plane data, return false, thus the caller will not try to read invalid memory. https://bugzilla.gnome.org/show_bug.cgi?id=774213 --- gst/vaapi/gstvaapivideomemory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c index 03b7ec7540..143ee40d36 100644 --- a/gst/vaapi/gstvaapivideomemory.c +++ b/gst/vaapi/gstvaapivideomemory.c @@ -319,7 +319,7 @@ gst_video_meta_map_vaapi_memory (GstVideoMeta * meta, guint plane, *data = gst_vaapi_image_get_plane (mem->image, plane); *stride = gst_vaapi_image_get_pitch (mem->image, plane); info->flags = flags; - ret = TRUE; + ret = (*data != NULL); out: g_mutex_unlock (&mem->lock);