Skip to content

Commit 37592ad

Browse files
committed
fixed #2163
1 parent 7caa230 commit 37592ad

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Diff for: src/isomedia/box_funcs.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,10 @@ GF_Err gf_isom_box_parse_ex(GF_Box **outBox, GF_BitStream *bs, u32 parent_type,
310310
if (e && (e != GF_ISOM_INCOMPLETE_FILE)) {
311311
gf_isom_box_del(newBox);
312312
*outBox = NULL;
313+
if (is_root_box && (e==GF_SKIP_BOX))
314+
e = GF_ISOM_INVALID_FILE;
313315

314-
if (!skip_logs) {
316+
if (!skip_logs && (e!=GF_SKIP_BOX)) {
315317
GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[iso file] Read Box \"%s\" (start "LLU") failed (%s) - skipping\n", gf_4cc_to_str(type), start, gf_error_to_string(e)));
316318
}
317319
//we don't try to reparse known boxes that have been failing (too dangerous)

Diff for: src/isomedia/isom_intern.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,8 @@ static GF_Err gf_isom_parse_movie_boxes_internal(GF_ISOFile *mov, u32 *boxType,
373373
e = gf_isom_parse_root_box(&a, mov->movieFileMap->bs, boxType, bytesMissing, progressive_mode);
374374

375375
if (e >= 0) {
376-
376+
//safety check, should never happen
377+
if (!a) return GF_ISOM_INVALID_FILE;
377378
} else if (e == GF_ISOM_INCOMPLETE_FILE) {
378379
/*our mdat is uncomplete, only valid for READ ONLY files...*/
379380
if (mov->openMode != GF_ISOM_OPEN_READ) {

0 commit comments

Comments
 (0)