summaryrefslogtreecommitdiffstats
path: root/kpdf/xpdf
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-14 08:57:48 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-14 08:57:48 +0000
commit9116c29739aa3e15eb5e052d335b1f76700f6b32 (patch)
treec7301ec627341f5207fba729b3e2ad4e6cb9dfb0 /kpdf/xpdf
parent47d455dd55be855e4cc691c32f687f723d9247ee (diff)
downloadtdegraphics-9116c29739aa3e15eb5e052d335b1f76700f6b32.tar.gz
tdegraphics-9116c29739aa3e15eb5e052d335b1f76700f6b32.zip
* kpdf page rotate options
* kdvi options dialog enhancements * djvu plugin for kviewshell git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1062216 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpdf/xpdf')
-rw-r--r--kpdf/xpdf/xpdf/Stream.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/kpdf/xpdf/xpdf/Stream.cc b/kpdf/xpdf/xpdf/Stream.cc
index ab630241..20219522 100644
--- a/kpdf/xpdf/xpdf/Stream.cc
+++ b/kpdf/xpdf/xpdf/Stream.cc
@@ -410,15 +410,12 @@ StreamPredictor::StreamPredictor(Stream *strA, int predictorA,
ok = gFalse;
nVals = width * nComps;
- if (width <= 0 || nComps <= 0 || nBits <= 0 ||
- nComps > gfxColorMaxComps || nBits > 16 ||
- width >= INT_MAX / nComps ||
- nVals >= (INT_MAX - 7) / nBits) {
- return;
- }
pixBytes = (nComps * nBits + 7) >> 3;
rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
- if (rowBytes <= 0) {
+ if (width <= 0 || nComps <= 0 || nBits <= 0 ||
+ nComps > gfxColorMaxComps || nBits > 16 ||
+ width >= INT_MAX / nComps || // check for overflow in nVals
+ nVals >= (INT_MAX - 7) / nBits) { // check for overflow in rowBytes
return;
}
predLine = (Guchar *)gmalloc(rowBytes);