summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-04-07 05:45:53 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-04-07 05:45:53 +0000
commit644c33a4965025ea8435052710e2a5f59456436f (patch)
tree0ace8ca3a968571b66364efdd905ea38b53a3cc5
parentba516ae78362dfc74d2e564953af8f17ab66828c (diff)
downloadgdk-pixbuf-644c33a4965025ea8435052710e2a5f59456436f.tar.gz
Initialize the colormap to zero. (#171762, David Costanzo)
2005-04-07 Matthias Clasen <mclasen@redhat.com> * io-bmp.c (DecodeColormap): Initialize the colormap to zero. (#171762, David Costanzo)
-rw-r--r--gdk-pixbuf/ChangeLog5
-rw-r--r--gdk-pixbuf/io-bmp.c18
2 files changed, 22 insertions, 1 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog
index b1880958e..556d6c9ca 100644
--- a/gdk-pixbuf/ChangeLog
+++ b/gdk-pixbuf/ChangeLog
@@ -1,3 +1,8 @@
+2005-04-07 Matthias Clasen <mclasen@redhat.com>
+
+ * io-bmp.c (DecodeColormap): Initialize the colormap to
+ zero. (#171762, David Costanzo)
+
2005-04-03 Hans Breuer <hans@breuer.org>
* makefile.msc : follow .symbols changes
diff --git a/gdk-pixbuf/io-bmp.c b/gdk-pixbuf/io-bmp.c
index 4cdcc112c..f7be00469 100644
--- a/gdk-pixbuf/io-bmp.c
+++ b/gdk-pixbuf/io-bmp.c
@@ -462,7 +462,7 @@ static gboolean DecodeColormap (guchar *buff,
return TRUE;
}
- State->Colormap = g_malloc ((1 << State->Header.depth) * sizeof (*State->Colormap));
+ State->Colormap = g_malloc0 ((1 << State->Header.depth) * sizeof (*State->Colormap));
for (i = 0; i < State->Header.n_colors; i++)
{
@@ -1074,10 +1074,14 @@ gdk_pixbuf__bmp_image_load_increment(gpointer data,
gint BytesToCopy;
+ g_print ("load_inc\n");
if (context->read_state == READ_STATE_DONE)
return TRUE;
else if (context->read_state == READ_STATE_ERROR)
+ {
+ g_print ("ah\n");
return FALSE;
+ }
while (size > 0) {
if (context->BufferDone < context->BufferSize) { /* We still
@@ -1103,25 +1107,37 @@ gdk_pixbuf__bmp_image_load_increment(gpointer data,
if (!DecodeHeader (context->buff,
context->buff + 14, context,
error))
+ {
+ g_print ("bla\n");
return FALSE;
+ }
break;
case READ_STATE_PALETTE:
if (!DecodeColormap (context->buff, context, error))
+ {
+ g_print ("bleh\n");
return FALSE;
+ }
break;
case READ_STATE_BITMASKS:
if (!decode_bitmasks (context->buff, context, error))
+ {
+ g_print ("blurb\n");
return FALSE;
+ }
break;
case READ_STATE_DATA:
if (context->Compressed == BI_RGB || context->Compressed == BI_BITFIELDS)
OneLine (context);
else if (!DoCompressed (context, error))
+ {
+ g_print ("blurb\n");
return FALSE;
+ }
break;
case READ_STATE_DONE: