MPEG4Extractor.cpp: handle chunk_size > SIZE_MAX

chunk_size is a uint64_t, so it can legitimately be bigger
than SIZE_MAX, which would cause the subtraction to underflow.

https://code.google.com/p/android/issues/detail?id=182251

Bug: 23034759
Change-Id: Ic1637fb26bf6edb0feb1bcf2876fd370db1ed547

status_t MPEG4Extractor::verifyTrack(Track *track) {
 const char *mime;
    CHECK(track->meta->findCString(kKeyMIMEType, &mime));

 uint32_t type;
 const void *data;
 size_t size;
 if (!strcasecmp(mime, MEDIA_MIMETYPE_VIDEO_AVC)) {
 if (!track->meta->findData(kKeyAVCC, &type, &data, &size)
 || type != kTypeAVCC) {
 return ERROR_MALFORMED;
 }
 } else if (!strcasecmp(mime, MEDIA_MIMETYPE_VIDEO_HEVC)) {
 if (!track->meta->findData(kKeyHVCC, &type, &data, &size)
 || type != kTypeHVCC) {
 return ERROR_MALFORMED;
 }
 } else if (!strcasecmp(mime, MEDIA_MIMETYPE_VIDEO_MPEG4)
 || !strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC)) {
 if (!track->meta->findData(kKeyESDS, &type, &data, &size)
 || type != kTypeESDS) {
 return ERROR_MALFORMED;
 }
 }

 if (track->sampleTable == NULL || !track->sampleTable->isValid()) {
        ALOGE("stbl atom missing/invalid.");
 return ERROR_MALFORMED;
 }

 return OK;
}

status_t MPEG4Extractor::verifyTrack(Track *track) {
 const char *mime;
    CHECK(track->meta->findCString(kKeyMIMEType, &mime));

 uint32_t type;
 const void *data;
 size_t size;
 if (!strcasecmp(mime, MEDIA_MIMETYPE_VIDEO_AVC)) {
 if (!track->meta->findData(kKeyAVCC, &type, &data, &size)
 || type != kTypeAVCC) {
 return ERROR_MALFORMED;
 }
 } else if (!strcasecmp(mime, MEDIA_MIMETYPE_VIDEO_HEVC)) {
 if (!track->meta->findData(kKeyHVCC, &type, &data, &size)
 || type != kTypeHVCC) {
 return ERROR_MALFORMED;
 }
 } else if (!strcasecmp(mime, MEDIA_MIMETYPE_VIDEO_MPEG4)
 || !strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC)) {
 if (!track->meta->findData(kKeyESDS, &type, &data, &size)
 || type != kTypeESDS) {
 return ERROR_MALFORMED;
 }
 }

 if (track->sampleTable == NULL || !track->sampleTable->isValid()) {
        ALOGE("stbl atom missing/invalid.");
 return ERROR_MALFORMED;
 }

 return OK;
}
