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 698563 - Ensure correct error reporting when CreateDIBSection fails
Ensure correct error reporting when CreateDIBSection fails
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.24.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-04-22 12:52 UTC by Aleksander Morgado
Modified: 2013-04-29 12:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for the issue. (1.43 KB, patch)
2013-04-22 12:53 UTC, Aleksander Morgado
committed Details | Review

Description Aleksander Morgado 2013-04-22 12:52:23 UTC
In gdkpixmap-win32.c:

      hbitmap = CreateDIBSection (hdc, (BITMAPINFO *) &bmi,
				  iUsage, (PVOID *) &bits, NULL, 0);
      GDI_CALL (ReleaseDC, (hwnd, hdc));
      if (hbitmap == NULL)
	{
	  WIN32_GDI_FAILED ("CreateDIBSection");
	  g_object_unref ((GObject *) pixmap);
	  return NULL;
	}

If CreateDIBSection() fails, we still call ReleaseDC() before showing the error with WIN32_GDI_FAILED.
Comment 1 Aleksander Morgado 2013-04-22 12:53:19 UTC
Created attachment 242131 [details] [review]
Patch for the issue.
Comment 2 Matthias Clasen 2013-04-29 03:02:53 UTC
Review of attachment 242131 [details] [review]:

Looks ok
Comment 3 Aleksander Morgado 2013-04-29 12:28:24 UTC
Pushed.