From cadd9f8c992a1d81666bc1c7b697145d3cb17c83 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Thu, 31 Jul 2014 12:33:23 -0400 Subject: [PATCH] fixed #230, also changed stream.atEnd() to gallery.atEnd() for better clarity (no change in behavior intendend) --- openbr/plugins/gallery.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openbr/plugins/gallery.cpp b/openbr/plugins/gallery.cpp index cd59b3e..7711589 100644 --- a/openbr/plugins/gallery.cpp +++ b/openbr/plugins/gallery.cpp @@ -141,11 +141,11 @@ class BinaryGallery : public Gallery TemplateList readBlock(bool *done) { - if (stream.atEnd()) + if (gallery.atEnd()) gallery.seek(0); TemplateList templates; - while ((templates.size() < readBlockSize) && !stream.atEnd()) { + while ((templates.size() < readBlockSize) && !gallery.atEnd()) { const Template t = readTemplate(); if (t.isEmpty() && t.file.isNull()) continue; @@ -157,7 +157,7 @@ class BinaryGallery : public Gallery break; } - *done = stream.atEnd(); + *done = gallery.atEnd(); return templates; } @@ -255,7 +255,8 @@ class utGallery : public BinaryGallery t.file.set("URL", QString(data.data())); t.append(cv::Mat(1, ut.size - ut.urlSize, CV_8UC1, data.data() + ut.urlSize).clone() /* We don't want a shallow copy! */); } else { - qFatal("Failed to read universal template header!"); + if (!gallery.atEnd()) + qFatal("Failed to read universal template header!"); } return t; } -- libgit2 0.21.4