After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 735078 - gst_gl_handle_set_context may unref a NULL GstGLDisplay
gst_gl_handle_set_context may unref a NULL GstGLDisplay
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.4.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-08-20 01:31 UTC by comicfans44
Modified: 2014-08-21 05:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
misc patch to fix the bug (813 bytes, patch)
2014-08-21 01:40 UTC, comicfans44
committed Details | Review

Description comicfans44 2014-08-20 01:31:05 UTC
I found  last commit changed gstglutils.c:770

   gst_object_replace ((GstObject **) display, (GstObject *) replacement);

to

  if (replacement) {
    GstGLDisplay *old = *display;
    *display = replacement;
    gst_object_unref (old);  --> didn't consider NULL
  }

should this check if old!=NULL first, or should this be

if (replacement) {
 gst_object_replace ((GstObject **) display, (GstObject *) replacement);
 gst_object_unref(replacement);
}

?
Comment 1 Matthew Waters (ystreet00) 2014-08-21 00:33:39 UTC
Good catch.

Either will work, although I would go with the first option (checking old != NULL).

Could you whip up a patch please?
Comment 2 comicfans44 2014-08-21 01:40:48 UTC
Created attachment 284031 [details] [review]
misc patch to fix the bug

(In reply to comment #1)
> Good catch.
> 
> Either will work, although I would go with the first option (checking old !=
> NULL).
> 
> Could you whip up a patch please?

my pleasure, and this is the patch
Comment 3 Matthew Waters (ystreet00) 2014-08-21 05:02:43 UTC
commit 4c65eca7beab90b3fee4744af08b622e88303642
Author: Wang Xin-yu (王昕宇) <comicfans44@gmail.com>
Date:   Wed Aug 20 09:37:01 2014 +0800

    gl: check null before unref GstGLDisplay

and 1.4
commit dad05c201ea804225155f778ae5d15d912d4d249