Fix missing NextMarker in JPEGDecoder

BZ: 112609

Change-Id: I3576f8116607b94a2119a865525597aa8b1c261f
Signed-off-by: Lai, Jim <jim.lai@intel.com>
Reviewed-on: http://android.intel.com:8080/113751
Reviewed-by: cactus <cactus@intel.com>
Reviewed-by: Guo, Nana N <nana.n.guo@intel.com>
Reviewed-by: Shi, PingX <pingx.shi@intel.com>
Tested-by: Shi, PingX <pingx.shi@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
diff --git a/imagedecoder/JPEGParser.c b/imagedecoder/JPEGParser.c
index d724008..4ad13b8 100644
--- a/imagedecoder/JPEGParser.c
+++ b/imagedecoder/JPEGParser.c
@@ -73,8 +73,12 @@
             break;
         }
     }
-
-    return readNextByte(parser);
+	/* check the next byte to make sure we don't miss the real marker*/
+	uint8_t tempNextByte = readNextByte(parser);
+	if (tempNextByte == 0xff)
+	    return readNextByte(parser);
+	else
+		return tempNextByte;
 }
 
 boolean setByteOffset(CJPEGParse* parser, uint32_t byte_offset)