From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12106 invoked by alias); 7 Jul 2003 22:31:00 -0000 Mailing-List: contact guile-gtk-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: guile-gtk-owner@sources.redhat.com Received: (qmail 12064 invoked from network); 7 Jul 2003 22:30:59 -0000 Received: from unknown (HELO snoopy.pacific.net.au) (61.8.0.36) by sources.redhat.com with SMTP; 7 Jul 2003 22:30:59 -0000 Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.2.228.40]) by snoopy.pacific.net.au (8.12.3/8.12.3/Debian-6.3) with ESMTP id h67MUvZY011207 for ; Tue, 8 Jul 2003 08:30:58 +1000 Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id h67MUvQg019486 for ; Tue, 8 Jul 2003 08:30:57 +1000 (EST) Received: from localhost (ppp112.dyn228.pacific.net.au [203.143.228.112]) by wisma.pacific.net.au (8.12.9/8.12.9) with ESMTP id h67MUunh005381 for ; Tue, 8 Jul 2003 08:30:56 +1000 (EST) Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 19ZeVV-0000ej-00; Tue, 08 Jul 2003 08:30:49 +1000 To: guile-gtk@sources.redhat.com Subject: gdk-image-new-bitmap and malloc From: Kevin Ryde Mail-Copies-To: never Date: Mon, 07 Jul 2003 22:31:00 -0000 Message-ID: <87d6gmm0km.fsf@zip.com.au> User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SW-Source: 2003-q3/txt/msg00005.txt.bz2 --=-=-= Content-length: 155 A bit of a bug fix, * gdk-support.c (gdk_image_new_bitmap_interp): Copy data into a malloced block, as demanded by gdk_image_new_bitmap. --=-=-= Content-Disposition: attachment; filename=gdk-support.c.image-bitmap.diff Content-length: 794 --- gdk-support.c.~1.24.~ 2003-06-19 11:03:47.000000000 +1000 +++ gdk-support.c 2003-07-07 17:56:13.000000000 +1000 @@ -1122,10 +1122,15 @@ gdk_image_new_bitmap_interp (GdkVisual *visual, guchar data[], int count, gint width, gint height) { + static const char func_name[] = "gdk-image-new-bitmap"; + gpointer m_data; if (count * 8 < width * height) - scm_misc_error ("gdk-image-new-bitmap", "source bitmap is too small", - SCM_EOL); - return gdk_image_new_bitmap (visual, data, width, height); + scm_misc_error (func_name, "source bitmap is too small", SCM_EOL); + m_data = malloc (count); + if (m_data == NULL) + scm_memory_error (func_name); + memcpy (m_data, data, count); + return gdk_image_new_bitmap (visual, m_data, width, height); } GdkBitmap * --=-=-=--