You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
968 B
36 lines
968 B
From 625677ba4ec9f0b0bb930fcefab5b7fc91b9bae8 Mon Sep 17 00:00:00 2001
|
|
From: David Tardon <dtardon@redhat.com>
|
|
Date: Thu, 13 Dec 2012 12:49:19 +0100
|
|
Subject: [PATCH] coverity: do not let CDRDocument::parse throw
|
|
|
|
---
|
|
src/lib/CDRDocument.cpp | 12 +++++++++++-
|
|
1 file changed, 11 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/lib/CDRDocument.cpp b/src/lib/CDRDocument.cpp
|
|
index 4a75389..2633954 100644
|
|
--- a/src/lib/CDRDocument.cpp
|
|
+++ b/src/lib/CDRDocument.cpp
|
|
@@ -129,7 +129,17 @@ bool libcdr::CDRDocument::parse(::WPXInputStream *input, libwpg::WPGPaintInterfa
|
|
{
|
|
input->seek(0, WPX_SEEK_SET);
|
|
bool retVal = false;
|
|
- unsigned version = getCDRVersion(input);
|
|
+ unsigned version = 0;
|
|
+ try
|
|
+ {
|
|
+ version = getCDRVersion(input);
|
|
+ }
|
|
+ catch (libcdr::EndOfStreamException const&)
|
|
+ {
|
|
+ // This can only happen if isSupported() has not been called before
|
|
+ return false;
|
|
+ }
|
|
+
|
|
if (version)
|
|
{
|
|
input->seek(0, WPX_SEEK_SET);
|
|
--
|
|
1.8.0.1
|
|
|