summaryrefslogtreecommitdiff
path: root/graphics/gdk-pixbuf/patches/patch-ak
blob: 3407f2e811223a263e9afa6f3893f5b93cffcefc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$NetBSD: patch-ak,v 1.1.2.2 2005/04/03 03:32:58 snj 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;