summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-07-15 12:25:35 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-07-16 09:10:36 +0000
commit8840f5c2d7739e751e29b88224b416b20e3cd26a (patch)
tree35bd5eddb258f588a9cb3b594afa88cf0fe65ba8
parentf794f6501bcf18e5430d57128699fc579251f900 (diff)
bump size type
Change-Id: I2c32c253499a3efb22a3312ed1f0a608649ce124 (cherry picked from commit dc71a72753202d29544845cfd58992bac63c6837) Reviewed-on: https://gerrit.libreoffice.org/17090 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r--filter/qa/cppunit/data/met/fail/crash-1.metbin0 -> 681 bytes
-rw-r--r--filter/source/graphicfilter/ios2met/ios2met.cxx7
2 files changed, 4 insertions, 3 deletions
diff --git a/filter/qa/cppunit/data/met/fail/crash-1.met b/filter/qa/cppunit/data/met/fail/crash-1.met
new file mode 100644
index 000000000000..c46b4a9f168a
--- /dev/null
+++ b/filter/qa/cppunit/data/met/fail/crash-1.met
Binary files differ
diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx
index 6b38be429195..d86657d103d1 100644
--- a/filter/source/graphicfilter/ios2met/ios2met.cxx
+++ b/filter/source/graphicfilter/ios2met/ios2met.cxx
@@ -208,7 +208,7 @@ enum PenStyle { PEN_NULL, PEN_SOLID, PEN_DOT, PEN_DASH, PEN_DASHDOT };
struct OSPalette {
OSPalette * pSucc;
sal_uInt32 * p0RGB; // May be NULL!
- sal_uInt16 nSize;
+ size_t nSize;
};
struct OSArea {
@@ -743,12 +743,13 @@ void OS2METReader::SetPalette0RGB(sal_uInt16 nIndex, sal_uLong nCol)
}
if (pPaletteStack->p0RGB==NULL || nIndex>=pPaletteStack->nSize) {
sal_uInt32 * pOld0RGB=pPaletteStack->p0RGB;
- sal_uInt16 i,nOldSize=pPaletteStack->nSize;
+ size_t nOldSize = pPaletteStack->nSize;
if (pOld0RGB==NULL) nOldSize=0;
pPaletteStack->nSize=2*(nIndex+1);
if (pPaletteStack->nSize<256) pPaletteStack->nSize=256;
pPaletteStack->p0RGB = new sal_uInt32[pPaletteStack->nSize];
- for (i=0; i<pPaletteStack->nSize; i++) {
+ for (size_t i=0; i < pPaletteStack->nSize; ++i)
+ {
if (i<nOldSize) pPaletteStack->p0RGB[i]=pOld0RGB[i];
else if (i==0) pPaletteStack->p0RGB[i]=0x00ffffff;
else pPaletteStack->p0RGB[i]=0;