From 16c32c6dfbca03a46d1a2bb87b6c1c365e6179d5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Sat, 27 Dec 2014 20:36:37 +0100 Subject: JPEG: Fix reading of EXIF orientation. The orientation is unsigned short, read it as such. In JPEG-files created by Ricoh/Pentax cameras, the data is saved in Motorola format. Reading the wrong data size will produce invalid values when converting the byte order. Change-Id: I8f7c5dc5bfc10c02e090d3654aaefa047229a962 Task-number: QTBUG-43563 Reviewed-by: Friedemann Kleint --- src/gui/image/qjpeghandler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gui/image') diff --git a/src/gui/image/qjpeghandler.cpp b/src/gui/image/qjpeghandler.cpp index 87992bcced..9cf9947b6c 100644 --- a/src/gui/image/qjpeghandler.cpp +++ b/src/gui/image/qjpeghandler.cpp @@ -826,10 +826,10 @@ static int getExifOrientation(QByteArray &exifData) quint16 tag; quint16 type; quint32 components; - quint32 value; - - stream >> tag >> type >> components >> value; + quint16 value; + quint16 dummy; + stream >> tag >> type >> components >> value >> dummy; if (tag == 0x0112) { // Tag Exif.Image.Orientation if (components !=1) return -1; -- cgit v1.2.3