Skip to content

Commit

Permalink
add extra safety check during decode for bad file header
Browse files Browse the repository at this point in the history
should only trigger if someone doesn't check return values

Signed-off-by: Kimball Thurston <[email protected]>
  • Loading branch information
kdt3rd committed Sep 17, 2024
1 parent bbfacba commit bbab8d1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/OpenEXRCore/decoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@ exr_decoding_initialize (
}
}

// will have already been reported during header parse, but just
// stop the file from being read
if (!part->channels || part->channels->type != EXR_ATTR_CHLIST)
return EXR_ERR_INVALID_ATTR;

rv = internal_coding_fill_channel_info (
&(decode->channels),
&(decode->channel_count),
Expand Down

0 comments on commit bbab8d1

Please sign in to comment.