From: Matthew Waters Date: Thu, 8 Feb 2018 05:13:23 +0000 (+1100) Subject: gl/display/egl: Fix precondition in display_egl_get_from_native X-Git-Tag: 1.16.2~882 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=54701ceb4041b81f7c3074bad2c62b69a7c9ed80;p=platform%2Fupstream%2Fgst-plugins-base.git gl/display/egl: Fix precondition in display_egl_get_from_native We don't really want type=NONE as input and it was already impossible for that to occur with the other condtions. CID #1427144 --- diff --git a/gst-libs/gst/gl/egl/gstgldisplay_egl.c b/gst-libs/gst/gl/egl/gstgldisplay_egl.c index 448899c..81f9794 100644 --- a/gst-libs/gst/gl/egl/gstgldisplay_egl.c +++ b/gst-libs/gst/gl/egl/gstgldisplay_egl.c @@ -90,7 +90,8 @@ gst_gl_display_egl_finalize (GObject * object) * @display: pointer to a display (or 0) * * Attempts to create a new #EGLDisplay from @display. If @type is - * %GST_GL_DISPLAY_TYPE_ANY, then @display must be 0. + * %GST_GL_DISPLAY_TYPE_ANY, then @display must be 0. @type must not be + * %GST_GL_DISPLAY_TYPE_NONE. * * Returns: A #EGLDisplay or %EGL_NO_DISPLAY * @@ -103,19 +104,14 @@ gst_gl_display_egl_get_from_native (GstGLDisplayType type, guintptr display) EGLDisplay ret = EGL_NO_DISPLAY; _gst_eglGetPlatformDisplay_type _gst_eglGetPlatformDisplay; + g_return_val_if_fail (type != GST_GL_DISPLAY_TYPE_NONE, EGL_NO_DISPLAY); g_return_val_if_fail ((type != GST_GL_DISPLAY_TYPE_ANY && display != 0) || (type == GST_GL_DISPLAY_TYPE_ANY && display == 0), EGL_NO_DISPLAY); - g_return_val_if_fail ((type != GST_GL_DISPLAY_TYPE_NONE - || (type == GST_GL_DISPLAY_TYPE_NONE - && display == 0)), EGL_NO_DISPLAY); /* given an EGLDisplay already */ if (type == GST_GL_DISPLAY_TYPE_EGL) return (gpointer) display; - if (type == GST_GL_DISPLAY_TYPE_NONE) - type = GST_GL_DISPLAY_TYPE_ANY; - egl_exts = eglQueryString (EGL_NO_DISPLAY, EGL_EXTENSIONS); GST_DEBUG ("egl no display extensions: %s", egl_exts);