From: Fabian Keil <fk@fabiankeil.de>
Date: Wed, 21 May 2008 15:29:35 +0000 (+0000)
Subject: Fix gcc43 warnings.
X-Git-Tag: v_3_0_9~88
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/@default-cgi@/faq/static/@user-manual@?a=commitdiff_plain;h=aa586d5a8c1d3c602aed1d714a95490a7b44a47e;p=privoxy.git

Fix gcc43 warnings.
---

diff --git a/deanimate.c b/deanimate.c
index 8d0e6878..2ad811cc 100644
--- a/deanimate.c
+++ b/deanimate.c
@@ -1,4 +1,4 @@
-const char deanimate_rcs[] = "$Id: deanimate.c,v 1.17 2007/08/05 13:42:22 fabiankeil Exp $";
+const char deanimate_rcs[] = "$Id: deanimate.c,v 1.18 2008/03/28 15:13:38 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/deanimate.c,v $
@@ -39,6 +39,9 @@ const char deanimate_rcs[] = "$Id: deanimate.c,v 1.17 2007/08/05 13:42:22 fabian
  *
  * Revisions   :
  *    $Log: deanimate.c,v $
+ *    Revision 1.18  2008/03/28 15:13:38  fabiankeil
+ *    Remove inspect-jpegs action.
+ *
  *    Revision 1.17  2007/08/05 13:42:22  fabiankeil
  *    #1763173 from Stefan Huehner: declare some more functions static.
  *
@@ -332,7 +335,14 @@ static int gif_extract_image(struct binbuffer *src, struct binbuffer *dst)
     */
    if (c & 0x80)
    {
-      if (buf_copy(src, dst, (size_t) 3 * (1 << ((c & 0x07) + 1))))
+      int map_length = 3 * (1 << ((c & 0x07) + 1));
+      if (map_length <= 0)
+      {
+         log_error(LOG_LEVEL_DEANIMATE,
+            "colormap length = %d (%c)?", map_length, c);
+         return 1;
+      }
+      if (buf_copy(src, dst, (size_t)map_length))
       {
          return 1;
       }           
@@ -411,7 +421,14 @@ int gif_deanimate(struct binbuffer *src, struct binbuffer *dst, int get_first_im
     */
    if(c & 0x80)
    {
-      if (buf_copy(src, dst, (size_t) 3 * (1 << ((c & 0x07) + 1))))
+      int map_length = 3 * (1 << ((c & 0x07) + 1));
+      if (map_length <= 0)
+      {
+         log_error(LOG_LEVEL_DEANIMATE,
+            "colormap length = %d (%c)?", map_length, c);
+         return 1;
+      }
+      if (buf_copy(src, dst, (size_t)map_length))
       {
          return 1;
       }