[Libreoffice-commits] core.git: filter/source
Caolán McNamara
caolanm at redhat.com
Tue Oct 21 09:23:52 PDT 2014
filter/source/graphicfilter/ipcx/ipcx.cxx | 7 +++++++
1 file changed, 7 insertions(+)
New commits:
commit d0be09322d127e7d517851db38c764d57fbab2dc
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 21 17:20:15 2014 +0100
coverity#1242908 Untrusted value as argument
Change-Id: If9dd92c361d406c435329d29870dc8bb07a8ba7b
diff --git a/filter/source/graphicfilter/ipcx/ipcx.cxx b/filter/source/graphicfilter/ipcx/ipcx.cxx
index 283cdeb..af82bd3 100644
--- a/filter/source/graphicfilter/ipcx/ipcx.cxx
+++ b/filter/source/graphicfilter/ipcx/ipcx.cxx
@@ -217,6 +217,13 @@ void PCXReader::ImplReadBody(BitmapWriteAccess * pAcc)
sal_uLong nLastPercent = 0;
sal_uInt8 nDat = 0, nCol = 0;
+ //sanity check there is enough data before trying allocation
+ if (nPlanes > m_rPCX.remainingSize() / nBytesPerPlaneLin)
+ {
+ nStatus = false;
+ return;
+ }
+
for( np = 0; np < nPlanes; np++ )
pPlane[ np ] = new sal_uInt8[ nBytesPerPlaneLin ];
More information about the Libreoffice-commits
mailing list