summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-11-11 17:48:26 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-11-12 12:25:15 +0000
commite76098b22e5d3f5bb422dfcca34b4d61fe2bd593 (patch)
treed704922229bc23814eb924dd246cb35c28983bcc /vcl
parente52de1ca778d76a60579a656f61013b0dec1fdba (diff)
valgrind+afl: check p1 at start of loop
Change-Id: I9ef947d9a9089f2bcf6c86711f10224a03abf394
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/graphicfilter/data/png/pass/afl-sample-IDAT.pngbin0 -> 260 bytes
-rw-r--r--vcl/source/gdi/pngread.cxx6
2 files changed, 4 insertions, 2 deletions
diff --git a/vcl/qa/cppunit/graphicfilter/data/png/pass/afl-sample-IDAT.png b/vcl/qa/cppunit/graphicfilter/data/png/pass/afl-sample-IDAT.png
new file mode 100644
index 000000000000..b116a92ecd2d
--- /dev/null
+++ b/vcl/qa/cppunit/graphicfilter/data/png/pass/afl-sample-IDAT.png
Binary files differ
diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index 2bbfede76210..36e6803e8e71 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -1030,9 +1030,11 @@ void PNGReaderImpl::ImplApplyFilter()
p1 += mnBPP;
// use left pixels
- do
+ while (p1 < pScanEnd)
+ {
*p1 = static_cast<sal_uInt8>( *p1 + *(p2++) );
- while( ++p1 < pScanEnd );
+ ++p1;
+ }
}
break;