Author: dynis
Date: Thu Jun 26 22:23:02 2008
New Revision: 4460
URL:
http://source.netsurf-browser.org?rev=4460&view=rev
Log:
Type correction; clear gif_animation's memory in gif_create()
Modified:
branches/dynis/libnsgif/examples/decode_gif.c
branches/dynis/libnsgif/libnsgif.c
Modified: branches/dynis/libnsgif/examples/decode_gif.c
URL:
http://source.netsurf-browser.org/branches/dynis/libnsgif/examples/decode...
==============================================================================
--- branches/dynis/libnsgif/examples/decode_gif.c (original)
+++ branches/dynis/libnsgif/examples/decode_gif.c Thu Jun 26 22:23:02 2008
@@ -83,14 +83,14 @@
/* decode the frames */
for (i = 0; i != gif.frame_count; i++) {
unsigned int row, col;
- char *image;
+ unsigned char *image;
code = gif_decode_frame(&gif, i);
if (code != GIF_OK)
warning("gif_decode_frame", code);
printf("# frame %u:\n", i);
- image = (char *) gif.frame_image;
+ image = (unsigned char *) gif.frame_image;
for (row = 0; row != gif.height; row++) {
for (col = 0; col != gif.width; col++) {
size_t z = (row * gif.width + col) * 4;
Modified: branches/dynis/libnsgif/libnsgif.c
URL:
http://source.netsurf-browser.org/branches/dynis/libnsgif/libnsgif.c?rev=...
==============================================================================
--- branches/dynis/libnsgif/libnsgif.c (original)
+++ branches/dynis/libnsgif/libnsgif.c Thu Jun 26 22:23:02 2008
@@ -149,20 +149,16 @@
*/
static bool clear_image = false;
+
+
/** Initialises necessary gif_animation members.
*/
void gif_create(gif_animation *gif, gif_bitmap_callback_vt *bitmap_callbacks) {
+ memset(gif, 0, sizeof(gif_animation));
gif->bitmap_callbacks = *bitmap_callbacks;
- gif->gif_data = NULL;
- gif->frame_image = NULL;
- gif->frames = NULL;
- gif->local_colour_table = NULL;
- gif->global_colour_table = NULL;
- gif->buffer_position = 0;
- gif->frame_count = 0;
- gif->frame_count_partial = 0;
gif->decoded_frame = GIF_INVALID_FRAME;
}
+
/** Initialises any workspace held by the animation and attempts to decode
any information that hasn't already been decoded.
@@ -361,7 +357,6 @@
*/
return return_value;
}
-
/** Updates the sprite memory size