File Added-exception-throw-on-Value-pointer-being-null.patch of Package exiv2.7392

From 336c9c6110ee832599096bac741f3caa99d63365 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= <dan.cermak@cgc-instruments.com>
Date: Sat, 7 Oct 2017 23:20:40 +0200
Subject: [PATCH 9/9] Added exception throw on Value pointer being null

v can be null if the typeId is invalid => throw an exception notifying
the user that his file is corrupted instead of the assertion

(cherry picked from commit 1841c2afd79db92180286e175d574500745f5412)
---
 src/tiffvisitor.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/tiffvisitor.cpp b/src/tiffvisitor.cpp
index 6e5d1754..41db9ddc 100644
--- a/src/tiffvisitor.cpp
+++ b/src/tiffvisitor.cpp
@@ -1545,7 +1545,9 @@ namespace Exiv2 {
             }
         }
         Value::AutoPtr v = Value::create(typeId);
-        assert(v.get());
+        if (!v.get()) {
+            throw Error(58);
+        }
         v->read(pData, size, byteOrder());
 
         object->setValue(v);
-- 
2.14.1

openSUSE Build Service is sponsored by