summaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2013-04-21 17:53:34 +0200
committerPali Rohár <pali.rohar@gmail.com>2013-04-21 17:53:34 +0200
commit1c1bfb9c785f4f2ed6d2a0488bf981808e1fde0c (patch)
treea15bdd98cca2d6a5ac4119a01f037a0fda2b9f12 /src/image.c
parent0cd7a0c2cc67b0623f19ac2da8555228842f6350 (diff)
download0xFFFF-1c1bfb9c785f4f2ed6d2a0488bf981808e1fde0c.tar.bz2
image: Fix buffer pointer in function image_hash_from_data
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/image.c b/src/image.c
index f5b2bf6..44655fb 100644
--- a/src/image.c
+++ b/src/image.c
@@ -442,7 +442,7 @@ void image_list_unlink(struct image_list * list) {
}
-static uint16_t do_hash(uint16_t * b, int len) {
+static uint16_t do_hash(uint16_t * b, size_t len) {
uint16_t result = 0;
@@ -457,11 +457,11 @@ uint16_t image_hash_from_data(struct image * image) {
unsigned char buf[0x20000];
uint16_t hash = 0;
- int ret;
+ size_t ret;
image_seek(image, 0);
- while ( ( ret = image_read(image, &buf, sizeof(buf)) ) )
- hash ^= do_hash((uint16_t *)&buf, ret);
+ while ( ( ret = image_read(image, buf, sizeof(buf)) ) )
+ hash ^= do_hash((uint16_t *)buf, ret);
return hash;
}