diff options
-rw-r--r-- | filter/source/graphicfilter/ipcx/ipcx.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/filter/source/graphicfilter/ipcx/ipcx.cxx b/filter/source/graphicfilter/ipcx/ipcx.cxx index 283cdeb18f0c..af82bd3d748d 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 ]; |