summaryrefslogtreecommitdiff
path: root/apps/plugins/imageviewer/gif
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/imageviewer/gif')
-rw-r--r--apps/plugins/imageviewer/gif/gif_decoder.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/plugins/imageviewer/gif/gif_decoder.c b/apps/plugins/imageviewer/gif/gif_decoder.c
index e45814cbef..f57eab1cf1 100644
--- a/apps/plugins/imageviewer/gif/gif_decoder.c
+++ b/apps/plugins/imageviewer/gif/gif_decoder.c
@@ -136,7 +136,7 @@ static void set_canvas_background(pixel_t *out, GifFileType *GifFile)
136 * to reset canvas to global background color specified in gif BUT 136 * to reset canvas to global background color specified in gif BUT
137 * all renderers I know use transparency instead. 137 * all renderers I know use transparency instead.
138 */ 138 */
139 memset(out, PIXEL_TRANSPARENT, PIXELS_SZ); 139 memset(out, PIXEL_TRANSPARENT, PIXELS_SZ);
140} 140}
141 141
142/* var names adhere to giflib coding style */ 142/* var names adhere to giflib coding style */
@@ -282,7 +282,8 @@ void gif_decode(struct gif_decoder *d,
282 Row + j, Col, Width); 282 Row + j, Col, Width);
283 } 283 }
284 284
285 pf_progress(25*(i+1), 100); 285 if (pf_progress != NULL)
286 pf_progress(25*(i+1), 100);
286 } 287 }
287 } 288 }
288 else 289 else
@@ -299,7 +300,8 @@ void gif_decode(struct gif_decoder *d,
299 gif2pixels(Line, pixels_buffer[buf_idx], 300 gif2pixels(Line, pixels_buffer[buf_idx],
300 Row + i, Col, Width); 301 Row + i, Col, Width);
301 302
302 pf_progress(100*(i+1)/Height, 100); 303 if (pf_progress != NULL)
304 pf_progress(25*(i+1), 100);
303 } 305 }
304 } 306 }
305 307
@@ -406,7 +408,7 @@ void gif_decode(struct gif_decoder *d,
406 free(pixels_buffer[1]); 408 free(pixels_buffer[1]);
407 409
408 free(Line); 410 free(Line);
409 411
410 /* WARNING !!!! */ 412 /* WARNING !!!! */
411 /* GifFile object is trashed from now on, DONT use it */ 413 /* GifFile object is trashed from now on, DONT use it */
412 /* Move bitmap in native format to the front of the buff */ 414 /* Move bitmap in native format to the front of the buff */