Skip to content

Commit

Permalink
Fix condition in webp data
Browse files Browse the repository at this point in the history
The data needs to be reallocated if the new data size is larger than the allocated size.
  • Loading branch information
City-busz authored Oct 19, 2024
1 parent 33f0552 commit 0ae69d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ webp_data* get_webp_data(FILE *fp) {
break;
}
size_t new_data_size = data_size + bytes_read;
if ( new_data_size < data_allocated_size ) {
if ( new_data_size > data_allocated_size ) {
data_allocated_size *= 2;
data = realloc(data, data_allocated_size);
}
Expand Down

0 comments on commit 0ae69d3

Please sign in to comment.