gtk+ r19754 - branches/gtk-2-12/gdk-pixbuf
- From: csaavedra svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r19754 - branches/gtk-2-12/gdk-pixbuf
- Date: Tue, 11 Mar 2008 20:51:09 +0000 (GMT)
Author: csaavedra
Date: Tue Mar 11 20:51:09 2008
New Revision: 19754
URL: http://svn.gnome.org/viewvc/gtk+?rev=19754&view=rev
Log:
2008-03-11 Claudio Saavedra <csaavedra alumnos utalca cl>
* io-bmp.c: (DecodeHeader): Check for the BMP header magic numbers
before decoding it. (#505085)
Modified:
branches/gtk-2-12/gdk-pixbuf/ChangeLog
branches/gtk-2-12/gdk-pixbuf/io-bmp.c
Modified: branches/gtk-2-12/gdk-pixbuf/io-bmp.c
==============================================================================
--- branches/gtk-2-12/gdk-pixbuf/io-bmp.c (original)
+++ branches/gtk-2-12/gdk-pixbuf/io-bmp.c Tue Mar 11 20:51:09 2008
@@ -258,6 +258,17 @@
{
gint clrUsed;
+ /* First check for the two first bytes content. A sane
+ BMP file must start with bytes 0x42 0x4D. */
+ if (*BFH != 0x42 || *(BFH + 1) != 0x4D) {
+ g_set_error (error,
+ GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
+ _("BMP image has bogus header data"));
+ State->read_state = READ_STATE_ERROR;
+ return FALSE;
+ }
+
/* FIXME this is totally unrobust against bogus image data. */
if (State->BufferSize < lsb_32 (&BIH[0]) + 14) {
State->BufferSize = lsb_32 (&BIH[0]) + 14;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]