Gitweb links:
...log
http://git.netsurf-browser.org/libnsgif.git/shortlog/75ed38539447571ec961...
...commit
http://git.netsurf-browser.org/libnsgif.git/commit/75ed38539447571ec961c9...
...tree
http://git.netsurf-browser.org/libnsgif.git/tree/75ed38539447571ec961c985...
The branch, master has been updated
via 75ed38539447571ec961c985c8a1e9cbd76573e2 (commit)
via aa6e2af43ebb898167f6dc0bb8215eacf0a17389 (commit)
from 59566cafec6ba3f0eca7718859f2a742469d5b47 (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=75ed38539447571ec9...
commit 75ed38539447571ec961c985c8a1e9cbd76573e2
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
GIF: Ensure frame clipping is applied to max lzw output length.
diff --git a/src/gif.c b/src/gif.c
index aeb70f2..84d4209 100644
--- a/src/gif.c
+++ b/src/gif.c
@@ -525,7 +525,7 @@ static nsgif_error nsgif__decode_simple(
uint32_t *restrict frame_data,
uint32_t *restrict colour_table)
{
- uint32_t pixels = gif->info.width * height;
+ uint32_t pixels;
uint32_t written = 0;
nsgif_error ret = NSGIF_OK;
lzw_result res;
@@ -550,6 +550,7 @@ static nsgif_error nsgif__decode_simple(
}
frame_data += (offset_y * gif->info.width);
+ pixels = gif->info.width * height;
while (pixels > 0) {
res = lzw_decode_map(gif->lzw_ctx,
commitdiff
http://git.netsurf-browser.org/libnsgif.git/commit/?id=aa6e2af43ebb898167...
commit aa6e2af43ebb898167f6dc0bb8215eacf0a17389
Author: DarthSim <darthsim(a)gmail.com>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
GIF: Try to recover after LZW_EOI_CODE.
diff --git a/src/gif.c b/src/gif.c
index 509883e..aeb70f2 100644
--- a/src/gif.c
+++ b/src/gif.c
@@ -471,7 +471,8 @@ static nsgif_error nsgif__decode_complex(
while (available == 0) {
if (res != LZW_OK) {
/* Unexpected end of frame, try to recover */
- if (res == LZW_OK_EOD) {
+ if (res == LZW_OK_EOD ||
+ res == LZW_EOI_CODE) {
ret = NSGIF_OK;
} else {
ret = nsgif__error_from_lzw(res);
@@ -557,7 +558,7 @@ static nsgif_error nsgif__decode_simple(
frame_data += written;
if (res != LZW_OK) {
/* Unexpected end of frame, try to recover */
- if (res == LZW_OK_EOD) {
+ if (res == LZW_OK_EOD || res == LZW_EOI_CODE) {
ret = NSGIF_OK;
} else {
ret = nsgif__error_from_lzw(res);
-----------------------------------------------------------------------
Summary of changes:
src/gif.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/gif.c b/src/gif.c
index 509883e..84d4209 100644
--- a/src/gif.c
+++ b/src/gif.c
@@ -471,7 +471,8 @@ static nsgif_error nsgif__decode_complex(
while (available == 0) {
if (res != LZW_OK) {
/* Unexpected end of frame, try to recover */
- if (res == LZW_OK_EOD) {
+ if (res == LZW_OK_EOD ||
+ res == LZW_EOI_CODE) {
ret = NSGIF_OK;
} else {
ret = nsgif__error_from_lzw(res);
@@ -524,7 +525,7 @@ static nsgif_error nsgif__decode_simple(
uint32_t *restrict frame_data,
uint32_t *restrict colour_table)
{
- uint32_t pixels = gif->info.width * height;
+ uint32_t pixels;
uint32_t written = 0;
nsgif_error ret = NSGIF_OK;
lzw_result res;
@@ -549,6 +550,7 @@ static nsgif_error nsgif__decode_simple(
}
frame_data += (offset_y * gif->info.width);
+ pixels = gif->info.width * height;
while (pixels > 0) {
res = lzw_decode_map(gif->lzw_ctx,
@@ -557,7 +559,7 @@ static nsgif_error nsgif__decode_simple(
frame_data += written;
if (res != LZW_OK) {
/* Unexpected end of frame, try to recover */
- if (res == LZW_OK_EOD) {
+ if (res == LZW_OK_EOD || res == LZW_EOI_CODE) {
ret = NSGIF_OK;
} else {
ret = nsgif__error_from_lzw(res);
--
NetSurf GIF Decoder