Gitweb links:
...log
http://git.netsurf-browser.org/libnsgif.git/shortlog/c7c807ad44462583bd3a136e4a575418ab29e9de
...commit
http://git.netsurf-browser.org/libnsgif.git/commit/c7c807ad44462583bd3a136e4a575418ab29e9de
...tree
http://git.netsurf-browser.org/libnsgif.git/tree/c7c807ad44462583bd3a136e4a575418ab29e9de
The branch, tlsa/buffer-lengths has been created
at c7c807ad44462583bd3a136e4a575418ab29e9de (commit)
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/libnsgif.git/commit/?id=c7c807ad44462583bd3a136e4a575418ab29e9de
commit c7c807ad44462583bd3a136e4a575418ab29e9de
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=5368f2f0e929f83a090e68171c33aad6d9b3b3b2
commit 5368f2f0e929f83a090e68171c33aad6d9b3b3b2
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=80c9c8d8e065a34662979ee002bd760df0b831a1
commit 80c9c8d8e065a34662979ee002bd760df0b831a1
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.
-----------------------------------------------------------------------
--
NetSurf GIF Decoder
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]