Skip to content

Commit

Permalink
Add static_cast to fix build error on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinbackhouse committed Aug 1, 2021
1 parent b8ed386 commit c641116
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pngimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,10 @@ namespace Exiv2 {
// decode the chunk
bool bGood = false;
if ( tEXt ) {
bGood = tEXtToDataBuf(data.pData_ + name_l, dataOffset-name_l, dataBuf);
bGood = tEXtToDataBuf(data.pData_ + name_l, static_cast<unsigned long>(dataOffset - name_l), dataBuf);
}
if ( zTXt || iCCP ) {
bGood = zlibToDataBuf(data.pData_ + name_l + 1, dataOffset - name_l - 1, dataBuf); // +1 = 'compressed' flag
bGood = zlibToDataBuf(data.pData_ + name_l + 1, static_cast<unsigned long>(dataOffset - name_l - 1), dataBuf); // +1 = 'compressed' flag
}
if ( iTXt ) {
bGood = (3 <= dataOffset) && (start < dataOffset-3); // good if not a nul chunk
Expand Down

0 comments on commit c641116

Please sign in to comment.