From dc1be62d75e654e17c2f4c02804b7fd48d5a2515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 28 Aug 2015 16:14:07 +0100 Subject: [PATCH] check stream status Change-Id: I609c8c4f4e843601361b61f55e0325ad99db3c23 --- sd/qa/unit/data/ppt/pass/hang-20.ppt | Bin 0 -> 7732 bytes sd/source/filter/ppt/pptin.cxx | 34 ++++++++++++++++++++------- 2 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 sd/qa/unit/data/ppt/pass/hang-20.ppt diff --git a/sd/qa/unit/data/ppt/pass/hang-20.ppt b/sd/qa/unit/data/ppt/pass/hang-20.ppt new file mode 100644 index 0000000000000000000000000000000000000000..7bfe75d7b1d9da3a08e28be7dfc0afc1ea3ce1fe GIT binary patch literal 7732 zcmeHLdvH|M8UOCR8?u7HkoD-Tr>(?oD=+O&cg< zZO60o+w=a;cfQv-_Z)b6Sl70njQX?mN|VKq^Uh!yl+muCOsEtP(NSRiyyG}-qX>%q zCmW;s@BO&vzaW8gSaV2Phd$(a0Ck=Z_<_N|Wk3N?2vFC=$Laq=0&}GazZS7%y2Ozu zWCgT5@N_vW#*+kNL14q``fts7dDuhm$}V~C`XiZ?>~9`gFNyt{fkwO7?Ww`)%O#9; zS&AwiEU7}dPL@g|ddOA(X{_iP;}B_*kN!ty_jC+(>v=LytvJvFPw_31aB45T!xJ7?wdXg!qx z3X0AIa0JLOpa`HkOMv0P<-iDFBya^V3b+!u3it#t8ladg;A)@@_#|)*a4m2hFa{V4 zTo2p;+z6BdH zM9%n+j7c-)gi(UZ1nDr@ULmiVv>*1Haxi}ua*>~#RrsF@Z;Ha3Vkmd8`Gum2j3S5+UWMO+Wr^r8WBbchtIQ^3xu8UWt6qhJY z9(8cqJ{xP2=K|kWl}qXgHprkHdeN;$QY@0eEA(h9>`us>RX#n4{^~n!i#;AE&Q!7Duq{eWv@<~pQIIoM!zi2Pm}XccPKGq`Iv1ffT+u@f!il_N!E=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(l#}CV+868CuBe*XOvSnI_0KFTQQvy-Egj=-8KiuyW=2$L6+Db z0$^^?t9#R?6;b4^04ePRiU3@v)Enw+$a!kN1<*570Cjm5;J3C9L`m;0?3-^Sq%|)V ztq)rhRXu=uZBxRU6^+G~z$RKy=eYjbX-TwXj^XJuJ6e}$N;XAWtT~ZLv@UGbG%XJ& zYMP?)7O6yk=;m4uSLODr%toGGY`3reQ}?@_f%Bk{73wQwn^NOw_5FJmJs^c%ay$-F;LcC$oaOeo?V6%`jp4mG-X~jy zARjmt)g1gCAtjHN?$X2)6lsjXTNyd-N!j}EX{UbmgTFoa?eSLzHa-shmw)i13bg$I z9h5iw9|lOR6`&q>0$imXVBF~dc%wZ4kUQ$1cF_g!o#F^E0!RV0sZ#)HlQ>^L`g?<^ zMn8q=*$L;&iH}RxCBosjHLsxwpE;gg+|jfw9E+7()$uxpCdDt`KFK%tkePe^z4JY# z1&TkmD|gJ1j|LN<)$4q%3P%<$jkQ=+;be4iJjmBKP1Nt)pO_ wu1~uEIfnFUnuQiJcB#^Zu79c4_2^v0`V1X(N%xP1%*PtmFI~C__IeioCuHmlAOHXW literal 0 HcmV?d00001 diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 530be9c158d1..76f331d191dd 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -280,7 +280,6 @@ bool ImplSdPPTImport::Import() if ( nSlideCount && pSection->GetProperty( PID_HEADINGPAIR, aPropItem ) ) { sal_uInt32 nSlideTitleIndex = 0, nSlideTitleCount = 0; - sal_uInt32 i, nTemp; OUString aUString; @@ -291,13 +290,14 @@ bool ImplSdPPTImport::Import() { nVecCount >>= 1; sal_uInt32 nEntryCount = 0; - for ( i = 0; i < nVecCount; i++ ) + for (sal_uInt32 i = 0; i < nVecCount; ++i) { if ( !aPropItem.Read( aUString, VT_EMPTY, false ) ) break; aPropItem.ReadUInt32( nType ); if ( ( nType != VT_I4 ) && ( nType != VT_UI4 ) ) break; + sal_uInt32 nTemp(0); aPropItem.ReadUInt32( nTemp ); if ( aUString == "Slide Titles" || aUString == "Folientitel" ) { @@ -312,17 +312,33 @@ bool ImplSdPPTImport::Import() aPropItem.ReadUInt32( nType ) .ReadUInt32( nVecCount ); - if ( ( nVecCount >= ( nSlideTitleIndex + nSlideTitleCount ) ) - && ( nType == ( VT_LPSTR | VT_VECTOR ) ) ) + bool bVecOk = ( ( nVecCount >= (nSlideTitleIndex + nSlideTitleCount) ) + && ( nType == ( VT_LPSTR | VT_VECTOR ) ) ); + + if (bVecOk) { - for ( i = 0; i != nSlideTitleIndex; i++ ) + for (sal_uInt32 i = 0; i != nSlideTitleIndex; ++i) { - aPropItem.ReadUInt32( nTemp ); - aPropItem.SeekRel( nTemp ); + sal_uInt32 nTemp(0); + aPropItem.ReadUInt32(nTemp); + if (!aPropItem.good()) + { + bVecOk = false; + break; + } + auto nPos = aPropItem.Tell() + nTemp; + if (nPos != aPropItem.Seek(nPos)) + { + bVecOk = false; + break; + } } - for ( i = 0; i < nSlideTitleCount; i++ ) + } + if (bVecOk) + { + for (sal_uInt32 i = 0; i < nSlideTitleCount; ++i) { - if ( !aPropItem.Read( aUString, nType, false ) ) + if (!aPropItem.Read(aUString, nType, false)) break; OUString aString( aUString );