Skip to content

Commit

Permalink
Fix #950 by enforcing subBox.length > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
piponazo committed Jul 15, 2019
1 parent 08d5490 commit 2117e56
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/jp2image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@
// included header files
#include "config.h"

#include "jp2image.hpp"
#include "tiffimage.hpp"
#include "image.hpp"
#include "image_int.hpp"
#include "basicio.hpp"
#include "enforce.hpp"
#include "error.hpp"
#include "futils.hpp"
#include "types.hpp"
#include "image.hpp"
#include "image_int.hpp"
#include "jp2image.hpp"
#include "safe_op.hpp"
#include "tiffimage.hpp"
#include "types.hpp"

// + standard includes
#include <array>
Expand Down Expand Up @@ -645,6 +646,7 @@ namespace Exiv2
#ifdef EXIV2_DEBUG_MESSAGES
std::cout << "Jp2Image::encodeJp2Header subbox: "<< toAscii(subBox.type) << " length = " << subBox.length << std::endl;
#endif
enforce(subBox.length > 0, kerCorruptedMetadata);
count += subBox.length;
newBox.type = subBox.type;
} else {
Expand Down

0 comments on commit 2117e56

Please sign in to comment.