summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-07-15 11:02:13 +0100
committerMichael Stahl <mstahl@redhat.com>2015-07-15 10:12:45 +0000
commiteb70bf3e486102205cf609fa4c879564745eff17 (patch)
tree333d1cdeaa2a1d4057ebbbe633e456ff810fc5b2 /filter
parente30f56e680a73b201f9059cd09a8ac8c78ebdd51 (diff)
file format documentation states these are signed
Change-Id: Iaca58dda19d24a767333ff642759414951a03e6d (cherry picked from commit 8a60e78769ebf6fc73ddc8ed7e43991fcb30fff4) Reviewed-on: https://gerrit.libreoffice.org/17063 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'filter')
-rw-r--r--filter/qa/cppunit/data/ras/fail/crash-1.rasbin0 -> 913 bytes
-rw-r--r--filter/source/graphicfilter/iras/iras.cxx18
2 files changed, 9 insertions, 9 deletions
diff --git a/filter/qa/cppunit/data/ras/fail/crash-1.ras b/filter/qa/cppunit/data/ras/fail/crash-1.ras
new file mode 100644
index 000000000000..d1abbaefcbae
--- /dev/null
+++ b/filter/qa/cppunit/data/ras/fail/crash-1.ras
Binary files differ
diff --git a/filter/source/graphicfilter/iras/iras.cxx b/filter/source/graphicfilter/iras/iras.cxx
index cca5bc899af1..6916daa5cc88 100644
--- a/filter/source/graphicfilter/iras/iras.cxx
+++ b/filter/source/graphicfilter/iras/iras.cxx
@@ -44,12 +44,12 @@ private:
bool mbStatus;
Bitmap maBmp;
- sal_uInt32 mnWidth, mnHeight; // Bildausmass in Pixeln
- sal_uInt16 mnDstBitsPerPix;
- sal_uInt16 mnDstColors;
- sal_uInt32 mnDepth, mnImageDatSize, mnType;
- sal_uInt32 mnColorMapType, mnColorMapSize;
- sal_uInt8 mnRepCount, mnRepVal; // RLE Decoding
+ sal_Int32 mnWidth, mnHeight; // Bildausmass in Pixeln
+ sal_uInt16 mnDstBitsPerPix;
+ sal_uInt16 mnDstColors;
+ sal_Int32 mnDepth, mnImageDatSize, mnType;
+ sal_Int32 mnColorMapType, mnColorMapSize;
+ sal_uInt8 mnRepCount, mnRepVal; // RLE Decoding
bool mbPalette;
bool ImplReadBody(BitmapWriteAccess * pAcc);
@@ -178,9 +178,9 @@ bool RASReader::ReadRAS(Graphic & rGraphic)
bool RASReader::ImplReadHeader()
{
- m_rRAS.ReadUInt32( mnWidth ).ReadUInt32( mnHeight ).ReadUInt32( mnDepth ).ReadUInt32( mnImageDatSize ). ReadUInt32( mnType ).ReadUInt32( mnColorMapType ).ReadUInt32( mnColorMapSize );
+ m_rRAS.ReadInt32(mnWidth).ReadInt32(mnHeight).ReadInt32(mnDepth).ReadInt32(mnImageDatSize).ReadInt32(mnType).ReadInt32(mnColorMapType).ReadInt32(mnColorMapSize);
- if ( mnWidth == 0 || mnHeight == 0 )
+ if ( mnWidth <= 0 || mnHeight <= 0 || mnImageDatSize <= 0 )
mbStatus = false;
switch ( mnDepth )
@@ -216,7 +216,7 @@ bool RASReader::ImplReadHeader()
bool RASReader::ImplReadBody(BitmapWriteAccess * pAcc)
{
- sal_uLong x, y;
+ sal_Int32 x, y;
sal_uInt8 nDat = 0;
sal_uInt8 nRed, nGreen, nBlue;
switch ( mnDstBitsPerPix )