Skip to content

Commit

Permalink
Remove an analyzer warning
Browse files Browse the repository at this point in the history
  • Loading branch information
aaaaaa123456789 committed Jan 15, 2022
1 parent d309485 commit a7732d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pnmread.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ void load_PNM_data (struct context * context, unsigned flags, size_t limit) {
size_t offset = 0;
context -> image -> type = PLUM_IMAGE_PNM;
// all image fields are zero-initialized, so the sizes are set to 0
while (offset < context -> size) {
do {
if (context -> image -> frames == 0xffffffffu) throw(context, PLUM_ERR_IMAGE_TOO_LARGE);
headers = ctxrealloc(context, headers, (context -> image -> frames + 1) * sizeof *headers);
struct PNM_image_header * header = headers + (context -> image -> frames ++);
Expand All @@ -16,7 +16,7 @@ void load_PNM_data (struct context * context, unsigned flags, size_t limit) {
validate_image_size(context, limit);
offset = header -> datastart + header -> datalength;
skip_PNM_whitespace(context, &offset);
}
} while (offset < context -> size);
allocate_framebuffers(context, flags, 0);
add_PNM_bit_depth_metadata(context, headers);
uint64_t * buffer = ctxmalloc(context, sizeof *buffer * context -> image -> width * context -> image -> height);
Expand Down

0 comments on commit a7732d1

Please sign in to comment.