summaryrefslogtreecommitdiff
path: root/libopie2
Side-by-side diff
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiemm/opieexif.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libopie2/opiemm/opieexif.cpp b/libopie2/opiemm/opieexif.cpp
index de49937..653216c 100644
--- a/libopie2/opiemm/opieexif.cpp
+++ b/libopie2/opiemm/opieexif.cpp
@@ -207,3 +207,3 @@ int ExifData::ReadJpegSections (QFile & infile, ReadMode_t ReadMode)
- size = QMAX( 0ul, infile.size()-infile.at() );
+ size = infile.size()-infile.at();
Data = (uchar *)malloc(size);
@@ -811,3 +811,7 @@ bool ExifData::scan(const QString & path)
QFile f(path);
- f.open(IO_ReadOnly);
+ if ( !f.open(IO_ReadOnly) ) {
+ owarn << "Unable to open file " << f.name() << " readonly" << oendl;
+ DiscardData();
+ return false;
+ }