OSDN Git Service

Fix a bug in IfdParser
authorEarl Ou <shunhsingou@google.com>
Wed, 1 Aug 2012 08:19:39 +0000 (16:19 +0800)
committerEarl Ou <shunhsingou@google.com>
Wed, 1 Aug 2012 08:19:39 +0000 (16:19 +0800)
Originally if we call next after the last tag without read the value,
we will receive a wrong tag.

Change-Id: Ib154d112a568c593270ee6676d4954a7c26567f2

src/com/android/gallery3d/exif/IfdParser.java

index 6af10c7..6638daf 100644 (file)
@@ -64,8 +64,10 @@ public class IfdParser {
 
         if (offset < mEndOfTagOffset) {
             skipTo(mNextOffset);
-            mNextOffset += TAG_SIZE;
-            return TYPE_NEW_TAG;
+            if(mNextOffset < mEndOfTagOffset) {
+                mNextOffset += TAG_SIZE;
+                return TYPE_NEW_TAG;
+            }
         }
 
         if (offset == mEndOfTagOffset) {