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.
This commit is contained in:
Matthias Clasen 2002-03-12 19:49:03 +00:00
parent ca63d83169
commit 7c59491ce4
2 changed files with 13 additions and 2 deletions

View File

@ -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.

View File

@ -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);