int MMFileUtilGetMetaDataFromMKV(MMFileFormatContext *formatContext)
{
MMFileIOHandle *fp = NULL;
- int probe_size = 10000;
+ long long probe_size = 10000;
unsigned char *buffer = NULL;
int ret = 0;
- int i;
+ long long i;
long long file_size = 0;
MMFILE_WEBM_PROJ_V2_BOX v2box = { 0, };
for (i = 0; i + 3 < probe_size; ++i) {
if (*(unsigned int *)(buffer + i) == FOURCC('e', 'q', 'u', 'i') ||
*(unsigned int *)(buffer + i) == FOURCC('c', 'b', 'm', 'p')) {
- debug_msg(DEBUG, "projection data found at offset %d bytes", i);
+ debug_msg(DEBUG, "projection data found at offset %lld bytes", i);
break;
}
}
goto exit;
}
- if ((i - (int)sizeof(MMFILE_WEBM_PROJ_V2_BOX)) < 0) {
+ if ((i - sizeof(MMFILE_WEBM_PROJ_V2_BOX)) < 0) {
debug_error(DEBUG, "error: invalid supposed projection info location");
ret = MMFILE_UTIL_FAIL;
goto exit;
}
basic_header.start_offset = mmfile_tell(fp);
+ if (basic_header.start_offset < 0) {
+ debug_error(DEBUG, "error: mmfile_tell");
+ goto exit;
+ }
if (g_junk_counter_limit == 0)
g_junk_counter_limit = mmfile_get_int_from_ini(MMFILE_INI_JUNKCNTLIMIT, MMFILE_DEFAULT_JUNKCNTLIMIT);