Skip to content
Permalink
Browse files Browse the repository at this point in the history
X3F/simple_decode_row: check for data offset limit
  • Loading branch information
alextutubalin committed Apr 4, 2020
1 parent 11c4db2 commit 5ab45b0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/x3f/x3f_utils_patched.cpp
Expand Up @@ -1122,6 +1122,8 @@ static void simple_decode_row(x3f_info_t *I, x3f_directory_entry_t *DE,
x3f_image_data_t *ID = &DEH->data_subsection.image_data;
x3f_huffman_t *HUF = ID->huffman;

if (row*row_stride > ID->data_size - (ID->columns*sizeof(uint32_t)))
throw LIBRAW_EXCEPTION_IO_CORRUPT;
uint32_t *data = (uint32_t *)((unsigned char *)ID->data + row * row_stride);

uint16_t c[3] = {0, 0, 0};
Expand Down

0 comments on commit 5ab45b0

Please sign in to comment.