diff --git a/include/exiv2/bmffimage.hpp b/include/exiv2/bmffimage.hpp index f03a5c30..d6bb880e 100644 --- a/include/exiv2/bmffimage.hpp +++ b/include/exiv2/bmffimage.hpp @@ -33,7 +33,17 @@ namespace Exiv2 { EXIV2API bool enableBMFF(bool enable = true); - struct Iloc; // We'll define this in bmffimage.cpp + struct Iloc + { + Iloc(uint32_t ID = 0, uint32_t start = 0, uint32_t length = 0) : ID_(ID), start_(start), length_(length){}; + virtual ~Iloc(){}; + + uint32_t ID_; + uint32_t start_; + uint32_t length_; + + std::string toString() const; + }; // class Iloc // ***************************************************************************** // class definitions diff --git a/src/bmffimage.cpp b/src/bmffimage.cpp index 3d13a163..18f8ee6f 100644 --- a/src/bmffimage.cpp +++ b/src/bmffimage.cpp @@ -89,20 +89,10 @@ namespace Exiv2 return enable; } - struct Iloc + std::string Iloc::toString() const { - Iloc(uint32_t ID = 0, uint32_t start = 0, uint32_t length = 0) : ID_(ID), start_(start), length_(length){}; - virtual ~Iloc(){}; - - uint32_t ID_; - uint32_t start_; - uint32_t length_; - - std::string toString() const - { - return Internal::stringFormat("ID = %u from,length = %u,%u", ID_, start_, length_); - } - }; // class Iloc + return Internal::stringFormat("ID = %u from,length = %u,%u", ID_, start_, length_); + } BmffImage::BmffImage(BasicIo::AutoPtr io, bool /* create */) : Image(ImageType::bmff, mdExif | mdIptc | mdXmp, io) { @@ -388,7 +378,7 @@ namespace Exiv2 // 12.1.5.2 case TAG_colr: { - if ( data.size_ >= skip+4 +8 /* 8 for safety */ ) { // .____.HLino..__mntrR 2 0 0 0 0 12 72 76 105 110 111 2 16 ... + if ( data.size_ >= (long) (skip+4+8) /* 8 for safety */ ) { // .____.HLino..__mntrR 2 0 0 0 0 12 72 76 105 110 111 2 16 ... // https://www.ics.uci.edu/~dan/class/267/papers/jpeg2000.pdf uint8_t meth = data.pData_[skip+0]; uint8_t prec = data.pData_[skip+1]; diff --git a/tests/bugfixes/github/test_pr1475_HIF.py b/tests/bugfixes/github/test_pr1475_HIF.py index 355935c6..90432b56 100644 --- a/tests/bugfixes/github/test_pr1475_HIF.py +++ b/tests/bugfixes/github/test_pr1475_HIF.py @@ -4,10 +4,18 @@ import system_tests from system_tests import BT import os +import sys import shlex import shutil import subprocess +# https://github.com/Exiv2/exiv2/issues/1215 +def error(s): + print('**',s,'**') + +def warn(s): + print('--',s) + def chop(blob): lines=[] line='' @@ -22,8 +30,12 @@ def chop(blob): return lines def runTest(cmd): + if sys.platform == 'win32': + args = cmd + else: + args = shlex.split(cmd) try: - p = subprocess.Popen( shlex.split(cmd), stdout=subprocess.PIPE,shell=False) + p = subprocess.Popen( args, stdout=subprocess.PIPE,shell=False) out,err = p.communicate() if p.returncode != 0: print('%s returncode = %d' % (cmd,p.returncode) )