forked from AuroraMiddleware/gtk
Check for overflow in one more place. (#313818, Tommi Komulainen)
2005-08-18 Matthias Clasen <mclasen@redhat.com> * io-ico.c (DecodeHeader): Check for overflow in one more place. (#313818, Tommi Komulainen)
This commit is contained in:
parent
86685d2ad0
commit
485b4f523f
@ -1,3 +1,8 @@
|
||||
2005-08-18 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* io-ico.c (DecodeHeader): Check for overflow in one more
|
||||
place. (#313818, Tommi Komulainen)
|
||||
|
||||
2005-08-15 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* io-jpeg.c (fatal_error_handler): Pay attention to the
|
||||
|
@ -261,7 +261,15 @@ static void DecodeHeader(guchar *Data, gint Bytes,
|
||||
so we know how many bytes are in the "header" part. */
|
||||
|
||||
State->HeaderSize = State->DIBoffset + 40; /* 40 = sizeof(InfoHeader) */
|
||||
|
||||
|
||||
if (State->HeaderSize < 0) {
|
||||
g_set_error (error,
|
||||
GDK_PIXBUF_ERROR,
|
||||
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
|
||||
_("Invalid header in icon"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (State->HeaderSize>State->BytesInHeaderBuf) {
|
||||
guchar *tmp=g_try_realloc(State->HeaderBuf,State->HeaderSize);
|
||||
if (!tmp) {
|
||||
|
Loading…
Reference in New Issue
Block a user