-rw-r--r-- | libopie2/opiemm/opieexif.cpp | 8 |
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 | |||
@@ -205,7 +205,7 @@ int ExifData::ReadJpegSections (QFile & infile, ReadMode_t ReadMode) | |||
205 | if (ReadMode & READ_IMAGE){ | 205 | if (ReadMode & READ_IMAGE){ |
206 | unsigned long size; | 206 | unsigned long size; |
207 | 207 | ||
208 | size = QMAX( 0ul, infile.size()-infile.at() ); | 208 | size = infile.size()-infile.at(); |
209 | Data = (uchar *)malloc(size); | 209 | Data = (uchar *)malloc(size); |
210 | if (Data == NULL){ | 210 | if (Data == NULL){ |
211 | return false; | 211 | return false; |
@@ -809,7 +809,11 @@ bool ExifData::scan(const QString & path) | |||
809 | int ret; | 809 | int ret; |
810 | 810 | ||
811 | QFile f(path); | 811 | QFile f(path); |
812 | f.open(IO_ReadOnly); | 812 | if ( !f.open(IO_ReadOnly) ) { |
813 | owarn << "Unable to open file " << f.name() << " readonly" << oendl; | ||
814 | DiscardData(); | ||
815 | return false; | ||
816 | } | ||
813 | 817 | ||
814 | // Scan the JPEG headers. | 818 | // Scan the JPEG headers. |
815 | ret = ReadJpegSections(f, READ_EXIF); | 819 | ret = ReadJpegSections(f, READ_EXIF); |