diff options
Diffstat (limited to 'fofi/FoFiBase.cc')
-rw-r--r-- | fofi/FoFiBase.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fofi/FoFiBase.cc b/fofi/FoFiBase.cc index 4adef2a..c9ca440 100644 --- a/fofi/FoFiBase.cc +++ b/fofi/FoFiBase.cc @@ -84,7 +84,7 @@ int FoFiBase::getU8(int pos, GBool *ok) { int FoFiBase::getS16BE(int pos, GBool *ok) { int x; - if (pos < 0 || pos+1 >= len || pos > INT_MAX - 1) { + if (pos < 0 || pos > INT_MAX - 1 || pos+1 >= len) { *ok = gFalse; return 0; } @@ -99,7 +99,7 @@ int FoFiBase::getS16BE(int pos, GBool *ok) { int FoFiBase::getU16BE(int pos, GBool *ok) { int x; - if (pos < 0 || pos+1 >= len || pos > INT_MAX - 1) { + if (pos < 0 || pos > INT_MAX - 1 || pos+1 >= len) { *ok = gFalse; return 0; } @@ -111,7 +111,7 @@ int FoFiBase::getU16BE(int pos, GBool *ok) { int FoFiBase::getS32BE(int pos, GBool *ok) { int x; - if (pos < 0 || pos+3 >= len || pos > INT_MAX - 3) { + if (pos < 0 || pos > INT_MAX - 3 || pos+3 >= len) { *ok = gFalse; return 0; } @@ -128,7 +128,7 @@ int FoFiBase::getS32BE(int pos, GBool *ok) { Guint FoFiBase::getU32BE(int pos, GBool *ok) { Guint x; - if (pos < 0 || pos+3 >= len || pos > INT_MAX - 3) { + if (pos < 0 || pos > INT_MAX - 3 || pos+3 >= len) { *ok = gFalse; return 0; } @@ -142,7 +142,7 @@ Guint FoFiBase::getU32BE(int pos, GBool *ok) { Guint FoFiBase::getU32LE(int pos, GBool *ok) { Guint x; - if (pos < 0 || pos+3 >= len || pos > INT_MAX - 3) { + if (pos < 0 || pos > INT_MAX - 3 || pos+3 >= len) { *ok = gFalse; return 0; } @@ -157,7 +157,7 @@ Guint FoFiBase::getUVarBE(int pos, int size, GBool *ok) { Guint x; int i; - if (pos < 0 || pos + size > len || pos > INT_MAX - size) { + if (pos < 0 || pos > INT_MAX - size || pos + size > len) { *ok = gFalse; return 0; } |