Skip to content

Commit

Permalink
Require at least one channel (AcademySoftwareFoundation#1182)
Browse files Browse the repository at this point in the history
When we started core, there was a thought to allow an empty image to
enable a metadata part. However, this needs wider support and causes
regressions from the existing c++ behavior

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
  • Loading branch information
kdt3rd authored and cary-ilm committed Oct 21, 2021
1 parent 9670874 commit 6e6ddba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/OpenEXRCore/validation.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ validate_channels (
EXR_ERR_NO_ATTR_BY_NAME,
"request to validate channel list, but data window not set to validate against");

if (channels->num_channels <= 0)
return f->report_error (
f,
EXR_ERR_FILE_BAD_HEADER,
"At least one channel required");

dw = curpart->data_window;
w = dw.max.x - dw.min.x + 1;
h = dw.max.y - dw.min.y + 1;
Expand Down

0 comments on commit 6e6ddba

Please sign in to comment.