diff --git a/gallerycommon/src/com/android/gallery3d/exif/CountedDataInputStream.java b/gallerycommon/src/com/android/gallery3d/exif/CountedDataInputStream.java
old mode 100644
new mode 100755
index c8300ad..7fddae9
--- a/gallerycommon/src/com/android/gallery3d/exif/CountedDataInputStream.java
+++ b/gallerycommon/src/com/android/gallery3d/exif/CountedDataInputStream.java
@@ -106,6 +106,12 @@
         return readShort() & 0xffff;
     }
 
+    public byte readByte() throws IOException {
+        readOrThrow(mByteArray, 0 ,1);
+        mByteBuffer.rewind();
+        return mByteBuffer.get(0);
+    }
+
     public int readInt() throws IOException {
         readOrThrow(mByteArray, 0 , 4);
         mByteBuffer.rewind();
diff --git a/gallerycommon/src/com/android/gallery3d/exif/ExifParser.java b/gallerycommon/src/com/android/gallery3d/exif/ExifParser.java
index ec653e9..9d60101 100755
--- a/gallerycommon/src/com/android/gallery3d/exif/ExifParser.java
+++ b/gallerycommon/src/com/android/gallery3d/exif/ExifParser.java
@@ -140,6 +140,8 @@
     protected static final int OFFSET_SIZE = 2;
 
     private static final Charset US_ASCII = Charset.forName("US-ASCII");
+    private static final byte APP1_UP = (byte)0xFF;
+    private static final byte APP1_DOWN = (byte)0xE1;
 
     protected static final int DEFAULT_IFD0_OFFSET = 8;
 
@@ -784,26 +786,29 @@
                 }
                 marker = dataStream.readShort();
             }
-
-
         } else{
             dataStream.skip(6);
             if (dataStream.readInt() == HEIC_HEADER) {
                 while(true){
                     try{
-                        short marker = dataStream.readShort();
-                        if (marker == JpegHeader.APP1) {
-                            int header = 0;
-                            short headerTail = 0;
-                            int length = dataStream.readUnsignedShort();
-                            header = dataStream.readInt();
-                            headerTail = dataStream.readShort();
-                            if (header == EXIF_HEADER && headerTail == EXIF_HEADER_TAIL) {
-                                mTiffStartPosition = dataStream.getReadByteCount();
-                                mApp1End = length;
-                                mOffsetToApp1EndFromSOF = mTiffStartPosition + mApp1End;
-                                return true;
+                        byte marker = dataStream.readByte();
+                        if(marker == APP1_UP){
+                            dataStream.mark(8);
+                            marker = dataStream.readByte();
+                            if (marker == APP1_DOWN){
+                                int header = 0;
+                                short headerTail = 0;
+                                int length = dataStream.readUnsignedShort();
+                                header = dataStream.readInt();
+                                headerTail = dataStream.readShort();
+                                if (header == EXIF_HEADER && headerTail == EXIF_HEADER_TAIL) {
+                                    mTiffStartPosition = dataStream.getReadByteCount();
+                                    mApp1End = length;
+                                    mOffsetToApp1EndFromSOF = mTiffStartPosition + mApp1End;
+                                    return true;
+                                }
                             }
+                            dataStream.reset();
                         }
                     }catch (Exception e){
                         break;
