Gitweb links:
...log
http://git.netsurf-browser.org/libnsgif.git/shortlog/3db59ff9dd4257f9ee0a...
...commit
http://git.netsurf-browser.org/libnsgif.git/commit/3db59ff9dd4257f9ee0a7c...
...tree
http://git.netsurf-browser.org/libnsgif.git/tree/3db59ff9dd4257f9ee0a7c02...
The branch, master has been updated
via 3db59ff9dd4257f9ee0a7c027b508bef32c2f2e3 (commit)
via e22e25143d985025d9c6d8811784280ee7d9302b (commit)
via 38c65283c2303516e792591721ce2091c44231dc (commit)
from aa6d8064c05f5a45132b154c266b5e2360a84dff (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/libnsgif.git/commit/?id=3db59ff9dd4257f9ee...
commit 3db59ff9dd4257f9ee0a7c027b508bef32c2f2e3
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
isolate LZW initialisation
diff --git a/src/libnsgif.c b/src/libnsgif.c
index 9045bbd..fe91111 100644
--- a/src/libnsgif.c
+++ b/src/libnsgif.c
@@ -222,6 +222,29 @@ static gif_result gif_clear_codes_LZW(gif_animation *gif)
/**
+ * Initialise LZW
+ *
+ * This initialises a LZW context ready to commence decompression.
+ *
+ * \param initial_code_size The size of codes used on clearing of code dictionary
+ */
+static gif_result gif_initialise_LZW(gif_animation *gif, int initial_code_size)
+{
+ lzw->set_code_size = initial_code_size;
+ lzw->code_size = lzw->set_code_size + 1;
+ lzw->clear_code = (1 << lzw->set_code_size);
+ lzw->end_code = lzw->clear_code + 1;
+ lzw->max_code_size = lzw->clear_code << 1;
+ lzw->max_code = lzw->clear_code + 2;
+ lzw->curbit = lzw->lastbit = 0;
+ lzw->last_byte = 2;
+ lzw->get_done = false;
+ lzw->direct = lzw->buf;
+
+ return gif_clear_codes_LZW(gif);
+}
+
+/**
* fill the LZW stack with decompressed data
*
* \param gif The GIF context.
@@ -1065,22 +1088,10 @@ gif_internal_decode_frame(gif_animation *gif,
}
}
gif->decoded_frame = frame;
-
- /* Initialise the LZW decoding */
- lzw->set_code_size = gif_data[0];
gif->buffer_position = (gif_data - gif->gif_data) + 1;
- /* Set our code variables */
- lzw->code_size = lzw->set_code_size + 1;
- lzw->clear_code = (1 << lzw->set_code_size);
- lzw->end_code = lzw->clear_code + 1;
- lzw->max_code_size = lzw->clear_code << 1;
- lzw->max_code = lzw->clear_code + 2;
- lzw->curbit = lzw->lastbit = 0;
- lzw->last_byte = 2;
- lzw->get_done = false;
- lzw->direct = lzw->buf;
- gif->current_error = gif_clear_codes_LZW(gif);
+ /* Initialise the LZW decoding */
+ gif->current_error = gif_initialise_LZW(gif, gif_data[0]);
if (gif->current_error != GIF_OK) {
return gif->current_error;
}
commitdiff
http://git.netsurf-browser.org/libnsgif.git/commit/?id=e22e25143d985025d9...
commit e22e25143d985025d9c6d8811784280ee7d9302b
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
make doxygen output contain static functions
diff --git a/docs/Doxyfile b/docs/Doxyfile
index fbbf523..4a30545 100644
--- a/docs/Doxyfile
+++ b/docs/Doxyfile
@@ -369,7 +369,7 @@ EXTRACT_PACKAGE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
-EXTRACT_STATIC = NO
+EXTRACT_STATIC = YES
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
# defined locally in source files will be included in the documentation.
commitdiff
http://git.netsurf-browser.org/libnsgif.git/commit/?id=38c65283c2303516e7...
commit 38c65283c2303516e792591721ce2091c44231dc
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
remove use of magic number for header size
diff --git a/src/libnsgif.c b/src/libnsgif.c
index b6d69e4..9045bbd 100644
--- a/src/libnsgif.c
+++ b/src/libnsgif.c
@@ -1195,7 +1195,7 @@ gif_result gif_initialise(gif_animation *gif, size_t size, unsigned
char *data)
/* Check for sufficient data to be a GIF (6-byte header + 7-byte
* logical screen descriptor)
*/
- if (gif->buffer_size < 13) {
+ if (gif->buffer_size < GIF_STANDARD_HEADER_SIZE) {
return GIF_INSUFFICIENT_DATA;
}
-----------------------------------------------------------------------
Summary of changes:
docs/Doxyfile | 2 +-
src/libnsgif.c | 41 ++++++++++++++++++++++++++---------------
2 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/docs/Doxyfile b/docs/Doxyfile
index fbbf523..4a30545 100644
--- a/docs/Doxyfile
+++ b/docs/Doxyfile
@@ -369,7 +369,7 @@ EXTRACT_PACKAGE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
-EXTRACT_STATIC = NO
+EXTRACT_STATIC = YES
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
# defined locally in source files will be included in the documentation.
diff --git a/src/libnsgif.c b/src/libnsgif.c
index b6d69e4..fe91111 100644
--- a/src/libnsgif.c
+++ b/src/libnsgif.c
@@ -222,6 +222,29 @@ static gif_result gif_clear_codes_LZW(gif_animation *gif)
/**
+ * Initialise LZW
+ *
+ * This initialises a LZW context ready to commence decompression.
+ *
+ * \param initial_code_size The size of codes used on clearing of code dictionary
+ */
+static gif_result gif_initialise_LZW(gif_animation *gif, int initial_code_size)
+{
+ lzw->set_code_size = initial_code_size;
+ lzw->code_size = lzw->set_code_size + 1;
+ lzw->clear_code = (1 << lzw->set_code_size);
+ lzw->end_code = lzw->clear_code + 1;
+ lzw->max_code_size = lzw->clear_code << 1;
+ lzw->max_code = lzw->clear_code + 2;
+ lzw->curbit = lzw->lastbit = 0;
+ lzw->last_byte = 2;
+ lzw->get_done = false;
+ lzw->direct = lzw->buf;
+
+ return gif_clear_codes_LZW(gif);
+}
+
+/**
* fill the LZW stack with decompressed data
*
* \param gif The GIF context.
@@ -1065,22 +1088,10 @@ gif_internal_decode_frame(gif_animation *gif,
}
}
gif->decoded_frame = frame;
-
- /* Initialise the LZW decoding */
- lzw->set_code_size = gif_data[0];
gif->buffer_position = (gif_data - gif->gif_data) + 1;
- /* Set our code variables */
- lzw->code_size = lzw->set_code_size + 1;
- lzw->clear_code = (1 << lzw->set_code_size);
- lzw->end_code = lzw->clear_code + 1;
- lzw->max_code_size = lzw->clear_code << 1;
- lzw->max_code = lzw->clear_code + 2;
- lzw->curbit = lzw->lastbit = 0;
- lzw->last_byte = 2;
- lzw->get_done = false;
- lzw->direct = lzw->buf;
- gif->current_error = gif_clear_codes_LZW(gif);
+ /* Initialise the LZW decoding */
+ gif->current_error = gif_initialise_LZW(gif, gif_data[0]);
if (gif->current_error != GIF_OK) {
return gif->current_error;
}
@@ -1195,7 +1206,7 @@ gif_result gif_initialise(gif_animation *gif, size_t size, unsigned
char *data)
/* Check for sufficient data to be a GIF (6-byte header + 7-byte
* logical screen descriptor)
*/
- if (gif->buffer_size < 13) {
+ if (gif->buffer_size < GIF_STANDARD_HEADER_SIZE) {
return GIF_INSUFFICIENT_DATA;
}
--
NetSurf GIF Decoder