summaryrefslogtreecommitdiffstats
path: root/src/file_bpg.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2016-02-01 18:15:26 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2016-02-01 18:15:26 +0100
commitf737bc7a4e6d6e5f87bd6cdb19b42160753295ed (patch)
tree7d6b252e53c81ad2a48c2df7fb0ef39b22f4afb0 /src/file_bpg.c
parentf2a4f329c211cdbb100d2a6a9bc8a8d3c8bf23ed (diff)
src/file_bpg.c - code style
Diffstat (limited to 'src/file_bpg.c')
-rw-r--r--src/file_bpg.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/file_bpg.c b/src/file_bpg.c
index 9312652..737eeb9 100644
--- a/src/file_bpg.c
+++ b/src/file_bpg.c
@@ -50,11 +50,10 @@ const file_hint_t file_hint_bpg= {
static unsigned int getue32(const unsigned char *buffer, const unsigned int buffer_size, unsigned int *buf_ptr)
{
unsigned int value = 0;
- unsigned int b;
int bitsRead = 0;
while (*buf_ptr < buffer_size)
{
- b = buffer[*buf_ptr];
+ const unsigned int b = buffer[*buf_ptr];
*buf_ptr = *buf_ptr + 1;
value <<= 7;
value |= (b & 0x7F);
@@ -71,9 +70,9 @@ static int header_check_bpg(const unsigned char *buffer, const unsigned int buff
{
unsigned int buf_ptr = 6;
// get image width, and throw it away
- unsigned int width = getue32(buffer, buffer_size, &buf_ptr);
+ const unsigned int width = getue32(buffer, buffer_size, &buf_ptr);
// get image height, and throw it away
- unsigned int height = getue32(buffer, buffer_size, &buf_ptr);
+ const unsigned int height = getue32(buffer, buffer_size, &buf_ptr);
unsigned int size = getue32(buffer, buffer_size, &buf_ptr);
if (size == 0) {
size = MAX_BPG_SIZE;