summaryrefslogtreecommitdiff
path: root/writerperfect
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2012-05-25 12:54:14 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2012-05-25 12:55:42 +0200
commitc7e71b31bd7b042da6aeda80bc92933e91533c1d (patch)
tree88821d273e75f038ae5a3384845d2da71eb539ae /writerperfect
parentfeeb57e0a63cdcd81898050d059e7933f62c5292 (diff)
Don't get out of bonds
Change-Id: Ifd743fe59d468b3d89c95f4963a038068cf34629
Diffstat (limited to 'writerperfect')
-rw-r--r--writerperfect/source/stream/WPXSvStream.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/writerperfect/source/stream/WPXSvStream.cxx b/writerperfect/source/stream/WPXSvStream.cxx
index 58c054456f64..d71e155377d2 100644
--- a/writerperfect/source/stream/WPXSvStream.cxx
+++ b/writerperfect/source/stream/WPXSvStream.cxx
@@ -180,6 +180,12 @@ WPXInputStream *WPXSvInputStream::getDocumentOLEStream(const char *name)
return 0;
}
+ // For the while don't return stream in this situation.
+ // Later, given how libcdr's zip stream implementation behaves,
+ // return the first stream in the storage if there is one.
+ if (i >= aElems.size())
+ return 0;
+
mxChildrenStreams.push_back( mxChildrenStorages.back()->OpenSotStream(
aElems[i], STREAM_STD_READ ));