Skip to content

Commit

Permalink
Merge pull request #2192 from Exiv2/027_issue2190
Browse files Browse the repository at this point in the history
[0.27] Detect integer-overflow and throw in that case
  • Loading branch information
piponazo authored Apr 4, 2022
2 parents 51c39d5 + f548681 commit 3409ddd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/exif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "types.hpp"
#include "error.hpp"
#include "basicio.hpp"
#include "safe_op.hpp"
#include "tiffimage.hpp"
#include "tiffimage_int.hpp"
#include "tiffcomposite_int.hpp" // for Tag::root
Expand Down Expand Up @@ -964,7 +965,7 @@ namespace {
{
long sum = 0;
for (long i = 0; i < md.count(); ++i) {
sum += md.toLong(i);
sum = Safe::add(sum, md.toLong(i));
}
return sum;
}
Expand Down
Binary file added test/data/issue_2190_poc.jp2
Binary file not shown.

0 comments on commit 3409ddd

Please sign in to comment.