Fix ParseElementHeader to support 0 payload elements

Cherry-pick'ing Change 5c83bbec9a5f6f00a349674ddad85b753d2ea219
from upstream. This fixes regression in some edge cases for mkv
playback.

BUG=26499283

Change-Id: I88de03219a3d941b6b2f251d384e29c36bdd4d9b

long Tags::Tag::Parse(IMkvReader* pReader, long long pos, long long size) {
 const long long stop = pos + size;

 while (pos < stop) {
 long long id, size;

 long status = ParseElementHeader(pReader, pos, stop, id, size);

 if (status < 0)
 return status;

 if (size == 0) // 0 length tag, read another
 continue;

 if (id == 0x27C8) { // SimpleTag ID
      status = ParseSimpleTag(pReader, pos, size);

 if (status < 0)
 return status;
 }

    pos += size;
 if (pos > stop)
 return E_FILE_FORMAT_INVALID;
 }

 if (pos != stop)
 return E_FILE_FORMAT_INVALID;
 return 0;
}

long Tags::Tag::Parse(IMkvReader* pReader, long long pos, long long size) {
 const long long stop = pos + size;

 while (pos < stop) {
 long long id, size;

 long status = ParseElementHeader(pReader, pos, stop, id, size);

 if (status < 0)
 return status;

 if (size == 0) // 0 length tag, read another
 continue;

 if (id == 0x27C8) { // SimpleTag ID
      status = ParseSimpleTag(pReader, pos, size);

 if (status < 0)
 return status;
 }

    pos += size;
 if (pos > stop)
 return E_FILE_FORMAT_INVALID;
 }

 if (pos != stop)
 return E_FILE_FORMAT_INVALID;
 return 0;
}
