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 668050 - theme-node-drawing: don't crash if st_theme_node_paint() is called on an empty area
theme-node-drawing: don't crash if st_theme_node_paint() is called on an empt...
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-01-16 19:55 UTC by Owen Taylor
Modified: 2012-08-19 04:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
theme-node-drawing: don't crash if st_theme_node_paint() is called on an empty area (2.13 KB, patch)
2012-01-16 19:55 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2012-01-16 19:55:36 UTC
See:

 https://bugzilla.redhat.com/show_bug.cgi?id=748293
Comment 1 Owen Taylor 2012-01-16 19:55:37 UTC
Created attachment 205400 [details] [review]
theme-node-drawing: don't crash if st_theme_node_paint() is called on an empty area

When st_theme_node_paint() was called with zero width or height and a theme
node with a shadow, we'd crash because we'd fail to allocate a texture with
an empty size, then unreference the NULL pointer.
Comment 2 Florian Müllner 2012-01-16 20:10:31 UTC
Review of attachment 205400 [details] [review]:

LGTM
Comment 3 Ray Strode [halfline] 2012-01-16 23:07:41 UTC
Review of attachment 205400 [details] [review]:

::: src/st/st-theme-node-drawing.c
@@ +1413,3 @@
           CoglHandle buffer, offscreen;
+          int texture_width = ceil (width);
+          int texture_height = ceil (height);

You don't mention this part in your commit message. Seems to be an independent change?
Comment 4 Owen Taylor 2012-01-16 23:39:15 UTC
(In reply to comment #3)
> Review of attachment 205400 [details] [review]:
> 
> ::: src/st/st-theme-node-drawing.c
> @@ +1413,3 @@
>            CoglHandle buffer, offscreen;
> +          int texture_width = ceil (width);
> +          int texture_height = ceil (height);
> 
> You don't mention this part in your commit message. Seems to be an independent
> change?

Not really an independent fix - what the patch is doing is making sure that the texture is at least 1,1 - so we make sure width/height are > 0 and then round up. yes, I suppose this is also fixing a bug in terms of misdrawing shadowed actors with non-integral allocations, but I don't think that's going to be very visible at least with a larger blur.

Pushed the change as is (didn't actually see the above comment until after I pushed)
Comment 5 Jasper St. Pierre (not reading bugmail) 2012-01-25 07:15:07 UTC
Review of attachment 205400 [details] [review]:

(marking patch committed to get it off the patch list)
Comment 6 Elliott Sales de Andrade 2012-08-19 04:39:38 UTC
If this has been committed, shouldn't this report be closed?
Comment 7 Jasper St. Pierre (not reading bugmail) 2012-08-19 04:49:36 UTC
Yes, we should.