From da09cf2cb875d17d06c081c744e7a25f4715f8b0 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 24 Oct 2017 11:57:03 +0100 Subject: ofz#3744 Undefined-shift MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4b3445c0ee50b9b50edba464da7ad61cda625d3e Reviewed-on: https://gerrit.libreoffice.org/43755 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- filter/source/graphicfilter/ieps/ieps.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index f2b138f550cd..e0cfb913d631 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -666,7 +666,7 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* ) for (long y = 0; bIsValid && y < nHeight; ++y) { int nBitsLeft = 0; - for (long x = 0; bIsValid && x < nWidth; ++x) + for (long x = 0; x < nWidth; ++x) { if ( --nBitsLeft < 0 ) { @@ -711,6 +711,8 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* ) } } } + if (!bIsValid) + break; if ( nBitDepth == 1 ) pAcc->SetPixelIndex( y, x, static_cast(nDat >> nBitsLeft) & 1 ); else -- cgit