diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2002-03-12 19:49:03 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2002-03-12 19:49:03 +0000 |
commit | 7c59491ce4a423bc8706eaf55a7c803216ccdf2b (patch) | |
tree | 03097b37f1ea2d8c5cfd1742893a855e898500c6 | |
parent | ca63d83169e7518d42aa0664c3e16ac5b99aa77d (diff) | |
download | gdk-pixbuf-7c59491ce4a423bc8706eaf55a7c803216ccdf2b.tar.gz |
Replace a g_assert_not_reached () which could actually be reached by a
* io-bmp.c (DecodeHeader): Replace a g_assert_not_reached ()
which could actually be reached by a proper error status return.
-rw-r--r-- | gdk-pixbuf/ChangeLog | 5 | ||||
-rw-r--r-- | gdk-pixbuf/io-bmp.c | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index ef78d7234..09a0954a7 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,8 @@ +2002-03-12 Matthias Clasen <maclas@gmx.de> + + * io-bmp.c (DecodeHeader): Replace a g_assert_not_reached () + which could actually be reached by a proper error status return. + 2002-03-05 Matthias Clasen <maclas@gmx.de> * test-loaders.c, test-images.h: More random tests. diff --git a/gdk-pixbuf/io-bmp.c b/gdk-pixbuf/io-bmp.c index 7f7c2d1dd..b8f9ee2bb 100644 --- a/gdk-pixbuf/io-bmp.c +++ b/gdk-pixbuf/io-bmp.c @@ -375,8 +375,14 @@ static gboolean DecodeHeader(unsigned char *BFH, unsigned char *BIH, } else if (State->Compressed == BI_BITFIELDS) { State->read_state = READ_STATE_BITMASKS; State->BufferSize = 12; - } else - g_assert_not_reached (); + } else { + 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; + } State->buff = g_realloc (State->buff, State->BufferSize); |