summaryrefslogtreecommitdiff
path: root/src/lib/emile
diff options
context:
space:
mode:
authorjiin.moon <jiin.moon@samsung.com>2015-09-21 23:44:49 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-09-21 23:44:52 +0200
commit95467e57077df3d08cd6ac52981eb743c2cd8fde (patch)
tree0a7bfeade7d577b58b53bac20b2e84271b604c15 /src/lib/emile
parent28d69200f9bba968e51941b302869d205e2eb13c (diff)
emile: fix can not check ifd offset of jpeg in MM(little endian) format
IFD offset is 4 byte. But just one byte is checked for it in previous patch. Reviewers: Hermet, jypark, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3053 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/emile')
-rw-r--r--src/lib/emile/emile_image.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/emile/emile_image.c b/src/lib/emile/emile_image.c
index 4b0feff9d1..0e184d6f14 100644
--- a/src/lib/emile/emile_image.c
+++ b/src/lib/emile/emile_image.c
@@ -897,14 +897,15 @@ _get_orientation_app1(const unsigned char *map,
897 return EINA_TRUE; 897 return EINA_TRUE;
898 } 898 }
899 899
900 /* 2. get 14th byte get info for IFD offset */ 900 /* 2. get 10&11 byte get info of "II(0x4949)" or "MM(0x4d4d)" */
901 /* 3. get 10&11 byte get info of "II(0x4949)" or "MM(0x4d4d)" */ 901 /* 3. get 14th - 17th byte get info for IFD offset */
902 /* 4. get directory entry IFD */ 902 /* 4. get directory entry IFD */
903 903
904 ifd_offset += *(buf + 14);
905 904
906 if (!memcmp(buf + 10, MM, sizeof(MM))) 905 if (!memcmp(buf + 10, MM, sizeof(MM)))
907 { 906 {
907 // get 4byte by little endian
908 ifd_offset += (*(buf + 14) << 24) + (*(buf + 15) << 16) + (*(buf + 16) << 8) + (*(buf + 17));
908 byte_align = EXIF_BYTE_ALIGN_MM; 909 byte_align = EXIF_BYTE_ALIGN_MM;
909 num_directory = ((*(buf + ifd_offset) << 8) + *(buf + ifd_offset + 1)); 910 num_directory = ((*(buf + ifd_offset) << 8) + *(buf + ifd_offset + 1));
910 orientation[0] = 0x01; 911 orientation[0] = 0x01;
@@ -912,6 +913,8 @@ _get_orientation_app1(const unsigned char *map,
912 } 913 }
913 else if (!memcmp(buf + 10, II, sizeof(II))) 914 else if (!memcmp(buf + 10, II, sizeof(II)))
914 { 915 {
916 // get 4byte by big endian
917 ifd_offset += (*(buf + 14)) + (*(buf + 15) << 8) + (*(buf + 16) << 16) + (*(buf + 17) << 24);
915 byte_align = EXIF_BYTE_ALIGN_II; 918 byte_align = EXIF_BYTE_ALIGN_II;
916 num_directory = ((*(buf + ifd_offset + 1) << 8) + *(buf + ifd_offset)); 919 num_directory = ((*(buf + ifd_offset + 1) << 8) + *(buf + ifd_offset));
917 orientation[0] = 0x12; 920 orientation[0] = 0x12;