Skip to content

Commit

Permalink
assert that value being converted to unsigned int is not negative
Browse files Browse the repository at this point in the history
  • Loading branch information
reunanen committed Nov 10, 2022
1 parent a122bf4 commit d187af3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/OpenEXR/ImfInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

#include <algorithm>
#include <fstream>
#include <assert.h>

OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER

Expand Down Expand Up @@ -338,6 +339,7 @@ bufferedReadPixels (InputFile::Data* ifd, int scanLine1, int scanLine2)
switch (toSlice.type)
{
case UINT: {
assert(toSlice.fillValue >= 0);
unsigned int fill = static_cast<unsigned int>(toSlice.fillValue);
for (int x = xStart; x <= levelRange.max.x;
x += toSlice.xSampling)
Expand Down

0 comments on commit d187af3

Please sign in to comment.