From 9b4871054d01a47b4c546952a0948553413840d6 Mon Sep 17 00:00:00 2001 From: erik Date: Mon, 22 Jan 2007 22:56:12 +0000 Subject: Every file in this commit makes a call to a function which returns a value. Each file also didn't check the return value. This commit changes it so that every single non-checked call in these files is checked. --- (limited to 'libopie2') 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) if (ReadMode & READ_IMAGE){ unsigned long size; - size = QMAX( 0ul, infile.size()-infile.at() ); + size = infile.size()-infile.at(); Data = (uchar *)malloc(size); if (Data == NULL){ return false; @@ -809,7 +809,11 @@ bool ExifData::scan(const QString & path) int ret; QFile f(path); - f.open(IO_ReadOnly); + if ( !f.open(IO_ReadOnly) ) { + owarn << "Unable to open file " << f.name() << " readonly" << oendl; + DiscardData(); + return false; + } // Scan the JPEG headers. ret = ReadJpegSections(f, READ_EXIF); -- cgit v0.9.0.2