From 86f53d33c95eb8fbf2dba3053107640d026bc3f0 Mon Sep 17 00:00:00 2001 From: "pnunn%netscape.com" Date: Wed, 12 Jul 2000 23:27:54 +0000 Subject: [PATCH] fix for bug#40785, #40767: added new state so gif load can be aborted without an error. pnunn rev:kin@netscape.com git-svn-id: svn://10.0.0.236/trunk@74126 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/modules/libimg/gifcom/gif.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mozilla/modules/libimg/gifcom/gif.cpp b/mozilla/modules/libimg/gifcom/gif.cpp index 090fb00ba6c..fcd8ca47b7c 100644 --- a/mozilla/modules/libimg/gifcom/gif.cpp +++ b/mozilla/modules/libimg/gifcom/gif.cpp @@ -116,7 +116,8 @@ typedef enum { gif_consume_netscape_extension, gif_consume_comment, gif_delay, - gif_wait_for_buffer_full + gif_wait_for_buffer_full, + gif_stop_animating //added for animation stop } gstate; /* "Disposal" method indicates how the image should be handled in the @@ -1508,7 +1509,7 @@ il_gif_write(il_container *ic, const PRUint8 *buf, int32 len) to stop decoding of subsequent frames. Only the first frame is displayed for eImageAnimation_None. */ - gs->state = gif_error; + gs->state = gif_stop_animating; break; } @@ -1609,6 +1610,10 @@ il_gif_write(il_container *ic, const PRUint8 *buf, int32 len) return MK_IMAGE_LOSSAGE; break; + case gif_stop_animating: + return 0; + break; + default: ILTRACE(0,("il:gif: unknown state")); PR_ASSERT(0);