Skip to content

Commit

Permalink
Added exception throw on Value pointer being null
Browse files Browse the repository at this point in the history
v can be null if the typeId is invalid => throw an exception notifying
the user that his file is corrupted instead of the assertion
  • Loading branch information
D4N committed Oct 15, 2017
1 parent c2c9fab commit 1841c2a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tiffvisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,9 @@ namespace Exiv2 {
}
}
Value::AutoPtr v = Value::create(typeId);
assert(v.get());
if (!v.get()) {
throw Error(58);
}
if ( !isize ) {
v->read(pData, size, byteOrder());
} else {
Expand Down

0 comments on commit 1841c2a

Please sign in to comment.