From 0e8069c1d8edca845a24250ceee608777ea3da54 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Wed, 21 Nov 2018 00:37:55 +0100 Subject: [PATCH] Fix another coverity issue --- rtexif/rtexif.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/rtexif/rtexif.cc b/rtexif/rtexif.cc index 947795c20..893d0fe22 100644 --- a/rtexif/rtexif.cc +++ b/rtexif/rtexif.cc @@ -2197,11 +2197,13 @@ void ExifManager::parseCIFF (int length, TagDirectory* root) t = new Tag (root, lookupAttrib (ifdAttribs, "Make")); t->initString (buffer); root->addTag (t); - fseek (f, strlen (buffer) - 63, SEEK_CUR); - fread (buffer, 64, 1, f); - t = new Tag (root, lookupAttrib (ifdAttribs, "Model")); - t->initString (buffer); - root->addTag (t); + if (!fseek (f, strlen (buffer) - 63, SEEK_CUR)) { + if (fread (buffer, 64, 1, f) == 1) { + t = new Tag (root, lookupAttrib (ifdAttribs, "Model")); + t->initString (buffer); + root->addTag (t); + } + } } if (type == 0x1818) {