From: Fabian Keil <fk@fabiankeil.de>
Date: Tue, 9 Feb 2021 10:19:08 +0000 (+0100)
Subject: gif_deanimate(): Confirm that that we have enough data
X-Git-Tag: v_3_0_32~31
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/developer-manual/user-manual/faq/static/@default-cgi@send-stylesheet?a=commitdiff_plain;h=88d5b57a4a639f88c937e7b22f6fe976b4380ce9;p=privoxy.git

gif_deanimate(): Confirm that that we have enough data

... before doing any work.

Fixes a crash when fuzzing with an empty document.

Reported by: Joshua Rogers (Opera).
---

diff --git a/deanimate.c b/deanimate.c
index bc64de63..a6759da4 100644
--- a/deanimate.c
+++ b/deanimate.c
@@ -333,6 +333,10 @@ int gif_deanimate(struct binbuffer *src, struct binbuffer *dst, int get_first_im
    {
       return 1;
    }
+   if (src->size <= 10)
+   {
+      return 1;
+   }
 
    c = buf_getbyte(src, 10);