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 738338 - quartz: NSWindow NULL check in get_scale_factor
quartz: NSWindow NULL check in get_scale_factor
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Quartz
3.14.x
Other Mac OS
: Normal normal
: ---
Assigned To: gtk-quartz maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-10-11 05:06 UTC by Philip Chimento
Modified: 2015-04-26 04:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
quartz: NSWindow NULL check in get_scale_factor (1.19 KB, patch)
2014-10-11 05:06 UTC, Philip Chimento
committed Details | Review

Description Philip Chimento 2014-10-11 05:06:43 UTC
Sending backingScaleFactor to a NULL NSWindow will silently give the
value 0 for the scale factor, causing insidious divide-by-zero bugs down
the line. This checks if the NSWindow is NULL first, as seems to happen
throughout the rest of the file.
    
Note that I don't have a hi-DPI OS X machine to test this on, though.
Comment 1 Philip Chimento 2014-10-11 05:06:45 UTC
Created attachment 288265 [details] [review]
quartz: NSWindow NULL check in get_scale_factor

Sending backingScaleFactor to a NULL NSWindow will silently give the
value 0 for the scale factor, causing insidious divide-by-zero bugs down
the line. This checks if the NSWindow is NULL first, as seems to happen
throughout the rest of the file.

Note that I don't have a hi-DPI OS X machine to test this on, though.
Comment 2 John Ralls 2014-12-24 22:58:26 UTC
Comment on attachment 288265 [details] [review]
quartz: NSWindow NULL check in get_scale_factor

Seems perfectly reasonable. Committed to master.