Fix deadlock during extracting tags 18/163318/3
authorVitaliy Cherepanov <v.cherepanov@samsung.com>
Fri, 8 Dec 2017 12:03:19 +0000 (15:03 +0300)
committerhj kim <backto.kim@samsung.com>
Fri, 22 Dec 2017 01:46:53 +0000 (01:46 +0000)
Change-Id: I16fe8b3844ace9be1edce741de533b40362ab4d6
Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
utils/mm_file_util_tag.c

index 8802cfa..6bfa64e 100755 (executable)
@@ -2148,7 +2148,14 @@ EXPORT_API int MMFileUtilGetMetaDataFromMP4(MMFileFormatContext *formatContext)
                        goto exit;
                }
 
-               basic_header.start_offset = mmfile_tell(fp);
+               long long new_pos = mmfile_tell(fp);
+
+               if ((moov_end == 0) && (new_pos <= basic_header.start_offset)) {
+                       ret = MMFILE_UTIL_FAIL;
+                       continue;
+               }
+               basic_header.start_offset = new_pos;
+
        }
 
 exit: