Change-Id: I867ae6ae067cfa09689b088de935b887b5459811
Name: libmm-fileinfo
Summary: Media Fileinfo
Name: libmm-fileinfo
Summary: Media Fileinfo
Release: 0
Group: System/Libraries
License: Apache-2.0
Release: 0
Group: System/Libraries
License: Apache-2.0
int MMFileUtilGetMetaDataFromMKV(MMFileFormatContext *formatContext)
{
MMFileIOHandle *fp = NULL;
int MMFileUtilGetMetaDataFromMKV(MMFileFormatContext *formatContext)
{
MMFileIOHandle *fp = NULL;
- int probe_size = 10000;
+ long long probe_size = 10000;
unsigned char *buffer = NULL;
int ret = 0;
unsigned char *buffer = NULL;
int ret = 0;
long long file_size = 0;
MMFILE_WEBM_PROJ_V2_BOX v2box = { 0, };
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')) {
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);
- 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;
debug_error(DEBUG, "error: invalid supposed projection info location");
ret = MMFILE_UTIL_FAIL;
goto exit;
}
basic_header.start_offset = mmfile_tell(fp);
}
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);
if (g_junk_counter_limit == 0)
g_junk_counter_limit = mmfile_get_int_from_ini(MMFILE_INI_JUNKCNTLIMIT, MMFILE_DEFAULT_JUNKCNTLIMIT);