author | erik <erik> | 2007-01-22 22:56:12 (UTC) |
---|---|---|
committer | erik <erik> | 2007-01-22 22:56:12 (UTC) |
commit | 9b4871054d01a47b4c546952a0948553413840d6 (patch) (unidiff) | |
tree | 4e0248489c2790cf4225a116cfb903b637d4cdf0 /libopie2 | |
parent | f60301bab1f8aa3693089036a3791a01ae6f9db8 (diff) | |
download | opie-9b4871054d01a47b4c546952a0948553413840d6.zip opie-9b4871054d01a47b4c546952a0948553413840d6.tar.gz opie-9b4871054d01a47b4c546952a0948553413840d6.tar.bz2 |
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.
-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 | |||
@@ -202,13 +202,13 @@ int ExifData::ReadJpegSections (QFile & infile, ReadMode_t ReadMode) | |||
202 | 202 | ||
203 | case M_SOS: // stop before hitting compressed data | 203 | case M_SOS: // stop before hitting compressed data |
204 | // If reading entire image is requested, read the rest of the data. | 204 | // If reading entire image is requested, read the rest of the data. |
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; |
212 | } | 212 | } |
213 | 213 | ||
214 | got = infile.readBlock((char*)Data, size); | 214 | got = infile.readBlock((char*)Data, size); |
@@ -806,13 +806,17 @@ ExifData::~ExifData() | |||
806 | //-------------------------------------------------------------------------- | 806 | //-------------------------------------------------------------------------- |
807 | bool ExifData::scan(const QString & path) | 807 | bool ExifData::scan(const QString & path) |
808 | { | 808 | { |
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); |
816 | 820 | ||
817 | if (ret == false){ | 821 | if (ret == false){ |
818 | owarn << "Not JPEG file!" << oendl; | 822 | owarn << "Not JPEG file!" << oendl; |