Skip to content
Permalink
Browse files Browse the repository at this point in the history
X3F: check for data offset limit
  • Loading branch information
alextutubalin committed Apr 4, 2020
1 parent 84bbb97 commit d75af00
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/x3f/x3f_utils_patched.cpp
Expand Up @@ -1042,6 +1042,8 @@ static void huffman_decode_row(x3f_info_t *I, x3f_directory_entry_t *DE,
int col;
bit_state_t BS;

if (HUF->row_offsets.element[row] > ID->data_size - 1)
throw LIBRAW_EXCEPTION_IO_CORRUPT;
set_bit_state(&BS, (uint8_t *)ID->data + HUF->row_offsets.element[row]);

for (col = 0; col < ID->columns; col++)
Expand Down

0 comments on commit d75af00

Please sign in to comment.