summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qbytearray.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qbytearray.cpp')
-rw-r--r--src/corelib/tools/qbytearray.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index e447985..22cee0e 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -538,9 +538,13 @@ QByteArray qUncompress(const uchar* data, int nbytes)
QByteArray baunzip;
int res;
do {
- baunzip.resize(len);
- res = ::uncompress((uchar*)baunzip.data(), &len,
- (uchar*)data+4, nbytes-4);
+ QT_TRY {
+ baunzip.resize(len);
+ res = ::uncompress((uchar*)baunzip.data(), &len,
+ (uchar*)data+4, nbytes-4);
+ } QT_CATCH (const std::bad_alloc &) {
+ res = Z_MEM_ERROR;
+ }
switch (res) {
case Z_OK: