2013-09-26 17:14:40 +02:00

21 lines
581 B
Plaintext

$NetBSD: patch-ak,v 1.1 2005/04/01 11:37:23 salo Exp $
--- gdk-pixbuf/io-bmp.c.orig 2002-09-27 23:12:40.000000000 +0200
+++ gdk-pixbuf/io-bmp.c 2005-04-01 13:05:14.000000000 +0200
@@ -245,7 +245,14 @@
static gboolean
grow_buffer (struct bmp_progressive_state *State)
{
- guchar *tmp = realloc (State->buff, State->BufferSize);
+ guchar *tmp;
+
+ if (State->BufferSize == 0) {
+ State->read_state = READ_STATE_ERROR;
+ return FALSE;
+ }
+
+ tmp = realloc (State->buff, State->BufferSize);
if (!tmp) {
State->read_state = READ_STATE_ERROR;
return FALSE;