Author: post
Date: 2013-01-27 17:36:18 +0100 (Sun, 27 Jan 2013)
New Revision: 4322
Modified:
trunk/plugins/meta-exiv2/exiv2-metadata.cpp
Log:
Avoid crash if rotation field contains 0 entries. (Bug #588)
Modified: trunk/plugins/meta-exiv2/exiv2-metadata.cpp
===================================================================
--- trunk/plugins/meta-exiv2/exiv2-metadata.cpp 2013-01-27 13:01:15 UTC (rev
4321)
+++ trunk/plugins/meta-exiv2/exiv2-metadata.cpp 2013-01-27 16:36:18 UTC (rev
4322)
@@ -121,12 +121,16 @@
i = orientation(exifData);
if (i != exifData.end())
{
- switch (i->getValue()->toLong())
+ std::auto_ptr<Exiv2::Value> val = i->getValue();
+ if (val->count())
{
- case 6: meta->orientation = 90;
- break;
- case 8: meta->orientation = 270;
- break;
+ switch (val->toLong())
+ {
+ case 6:
meta->orientation = 90;
+ break;
+ case 8:
meta->orientation = 270;
+ break;
+ }
}
}
#endif
_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit