Gitweb links:
...log
http://git.netsurf-browser.org/libnsgif.git/shortlog/ca8b9c3784f1f0f074cff1e5474d4a16b80885c6
...commit
http://git.netsurf-browser.org/libnsgif.git/commit/ca8b9c3784f1f0f074cff1e5474d4a16b80885c6
...tree
http://git.netsurf-browser.org/libnsgif.git/tree/ca8b9c3784f1f0f074cff1e5474d4a16b80885c6
The branch, master has been updated
via ca8b9c3784f1f0f074cff1e5474d4a16b80885c6 (commit)
via ccec86deb2d8063aa60b72cf0cc099c9990b6c24 (commit)
via 1f39b5d057f614a46c99534f8fb4d64846fdbbee (commit)
from fa1f47e6bec71ed970a02a517056fac677256c9d (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=ca8b9c3784f1f0f074cff1e5474d4a16b80885c6
commit ca8b9c3784f1f0f074cff1e5474d4a16b80885c6
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
gif: Remove unnecessary cast
diff --git a/src/gif.c b/src/gif.c
index 5f7e599..688fe12 100644
--- a/src/gif.c
+++ b/src/gif.c
@@ -1343,7 +1343,7 @@ static nsgif_error nsgif__process_frame(
return NSGIF_OK;
}
} else {
- pos = (uint8_t *)(gif->buf + gif->buf_pos);
+ pos = gif->buf + gif->buf_pos;
/* Check if we've finished */
if (pos < end && pos[0] == NSGIF_TRAILER) {
commitdiff
http://git.netsurf-browser.org/libnsgif.git/commit/?id=ccec86deb2d8063aa60b72cf0cc099c9990b6c24
commit ccec86deb2d8063aa60b72cf0cc099c9990b6c24
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
gif: Store buffer length/position as size_t
This makes the internal behaviour match the public API.
diff --git a/src/gif.c b/src/gif.c
index fb4b03e..5f7e599 100644
--- a/src/gif.c
+++ b/src/gif.c
@@ -32,7 +32,7 @@ typedef struct nsgif_frame {
struct nsgif_frame_info info;
/** offset (in bytes) to the GIF frame data */
- uint32_t frame_offset;
+ size_t frame_offset;
/** whether the frame has previously been decoded. */
bool decoded;
/** whether the frame is totally opaque */
@@ -102,9 +102,9 @@ struct nsgif {
/** pointer to GIF data */
const uint8_t *buf;
/** current index into GIF data */
- uint32_t buf_pos;
+ size_t buf_pos;
/** total number of bytes of GIF data available */
- uint32_t buf_len;
+ size_t buf_len;
/** current number of frame holders */
uint32_t frame_holders;
commitdiff
http://git.netsurf-browser.org/libnsgif.git/commit/?id=1f39b5d057f614a46c99534f8fb4d64846fdbbee
commit 1f39b5d057f614a46c99534f8fb4d64846fdbbee
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
lzw: Use size_t for buffer length/position
diff --git a/src/lzw.c b/src/lzw.c
index 6f85caa..3098ef5 100644
--- a/src/lzw.c
+++ b/src/lzw.c
@@ -36,9 +36,9 @@
* Note that an individual LZW code can be split over up to three sub-blocks.
*/
struct lzw_read_ctx {
- const uint8_t *restrict data; /**< Pointer to start of input data */
- uint32_t data_len; /**< Input data length */
- uint32_t data_sb_next; /**< Offset to sub-block size */
+ const uint8_t *restrict data; /**< Pointer to start of input data */
+ size_t data_len; /**< Input data length */
+ size_t data_sb_next; /**< Offset to sub-block size */
const uint8_t *sb_data; /**< Pointer to current sub-block in data */
size_t sb_bit; /**< Current bit offset in sub-block */
@@ -122,8 +122,8 @@ void lzw_context_destroy(struct lzw_ctx *ctx)
*/
static lzw_result lzw__block_advance(struct lzw_read_ctx *restrict ctx)
{
- uint32_t block_size;
- uint32_t next_block_pos = ctx->data_sb_next;
+ size_t block_size;
+ size_t next_block_pos = ctx->data_sb_next;
const uint8_t *data_next = ctx->data + next_block_pos;
if (next_block_pos >= ctx->data_len) {
@@ -260,8 +260,8 @@ lzw_result lzw_decode_init(
struct lzw_ctx *ctx,
uint8_t minimum_code_size,
const uint8_t *input_data,
- uint32_t input_length,
- uint32_t input_pos)
+ size_t input_length,
+ size_t input_pos)
{
struct lzw_table_entry *table = ctx->table;
lzw_result res;
@@ -322,8 +322,8 @@ lzw_result lzw_decode_init_map(
uint32_t transparency_idx,
const uint32_t *colour_table,
const uint8_t *input_data,
- uint32_t input_length,
- uint32_t input_pos)
+ size_t input_length,
+ size_t input_pos)
{
lzw_result res;
diff --git a/src/lzw.h b/src/lzw.h
index c68753a..f19432f 100644
--- a/src/lzw.h
+++ b/src/lzw.h
@@ -69,8 +69,8 @@ lzw_result lzw_decode_init(
struct lzw_ctx *ctx,
uint8_t minimum_code_size,
const uint8_t *input_data,
- uint32_t input_length,
- uint32_t input_pos);
+ size_t input_length,
+ size_t input_pos);
/**
* Read input codes until end of LZW context owned output buffer.
@@ -110,8 +110,8 @@ lzw_result lzw_decode_init_map(
uint32_t transparency_idx,
const uint32_t *colour_table,
const uint8_t *input_data,
- uint32_t input_length,
- uint32_t input_pos);
+ size_t input_length,
+ size_t input_pos);
/**
* Read LZW codes into client buffer, mapping output to colours.
-----------------------------------------------------------------------
Summary of changes:
src/gif.c | 8 ++++----
src/lzw.c | 18 +++++++++---------
src/lzw.h | 8 ++++----
3 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/gif.c b/src/gif.c
index fb4b03e..688fe12 100644
--- a/src/gif.c
+++ b/src/gif.c
@@ -32,7 +32,7 @@ typedef struct nsgif_frame {
struct nsgif_frame_info info;
/** offset (in bytes) to the GIF frame data */
- uint32_t frame_offset;
+ size_t frame_offset;
/** whether the frame has previously been decoded. */
bool decoded;
/** whether the frame is totally opaque */
@@ -102,9 +102,9 @@ struct nsgif {
/** pointer to GIF data */
const uint8_t *buf;
/** current index into GIF data */
- uint32_t buf_pos;
+ size_t buf_pos;
/** total number of bytes of GIF data available */
- uint32_t buf_len;
+ size_t buf_len;
/** current number of frame holders */
uint32_t frame_holders;
@@ -1343,7 +1343,7 @@ static nsgif_error nsgif__process_frame(
return NSGIF_OK;
}
} else {
- pos = (uint8_t *)(gif->buf + gif->buf_pos);
+ pos = gif->buf + gif->buf_pos;
/* Check if we've finished */
if (pos < end && pos[0] == NSGIF_TRAILER) {
diff --git a/src/lzw.c b/src/lzw.c
index 6f85caa..3098ef5 100644
--- a/src/lzw.c
+++ b/src/lzw.c
@@ -36,9 +36,9 @@
* Note that an individual LZW code can be split over up to three sub-blocks.
*/
struct lzw_read_ctx {
- const uint8_t *restrict data; /**< Pointer to start of input data */
- uint32_t data_len; /**< Input data length */
- uint32_t data_sb_next; /**< Offset to sub-block size */
+ const uint8_t *restrict data; /**< Pointer to start of input data */
+ size_t data_len; /**< Input data length */
+ size_t data_sb_next; /**< Offset to sub-block size */
const uint8_t *sb_data; /**< Pointer to current sub-block in data */
size_t sb_bit; /**< Current bit offset in sub-block */
@@ -122,8 +122,8 @@ void lzw_context_destroy(struct lzw_ctx *ctx)
*/
static lzw_result lzw__block_advance(struct lzw_read_ctx *restrict ctx)
{
- uint32_t block_size;
- uint32_t next_block_pos = ctx->data_sb_next;
+ size_t block_size;
+ size_t next_block_pos = ctx->data_sb_next;
const uint8_t *data_next = ctx->data + next_block_pos;
if (next_block_pos >= ctx->data_len) {
@@ -260,8 +260,8 @@ lzw_result lzw_decode_init(
struct lzw_ctx *ctx,
uint8_t minimum_code_size,
const uint8_t *input_data,
- uint32_t input_length,
- uint32_t input_pos)
+ size_t input_length,
+ size_t input_pos)
{
struct lzw_table_entry *table = ctx->table;
lzw_result res;
@@ -322,8 +322,8 @@ lzw_result lzw_decode_init_map(
uint32_t transparency_idx,
const uint32_t *colour_table,
const uint8_t *input_data,
- uint32_t input_length,
- uint32_t input_pos)
+ size_t input_length,
+ size_t input_pos)
{
lzw_result res;
diff --git a/src/lzw.h b/src/lzw.h
index c68753a..f19432f 100644
--- a/src/lzw.h
+++ b/src/lzw.h
@@ -69,8 +69,8 @@ lzw_result lzw_decode_init(
struct lzw_ctx *ctx,
uint8_t minimum_code_size,
const uint8_t *input_data,
- uint32_t input_length,
- uint32_t input_pos);
+ size_t input_length,
+ size_t input_pos);
/**
* Read input codes until end of LZW context owned output buffer.
@@ -110,8 +110,8 @@ lzw_result lzw_decode_init_map(
uint32_t transparency_idx,
const uint32_t *colour_table,
const uint8_t *input_data,
- uint32_t input_length,
- uint32_t input_pos);
+ size_t input_length,
+ size_t input_pos);
/**
* Read LZW codes into client buffer, mapping output to colours.
--
NetSurf GIF Decoder
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]