Skip to content

Commit b964fe4

Browse files
committed
rfadts: add size guard on dmx (#2400)
1 parent be9f8d3 commit b964fe4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: src/filters/reframe_adts.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ static void adts_dmx_check_dur(GF_Filter *filter, GF_ADTSDmxCtx *ctx)
300300
}
301301
}
302302
}
303-
303+
304304
p = gf_filter_pid_get_property(ctx->ipid, GF_PROP_PID_FILE_CACHED);
305305
if (p && p->value.boolean) ctx->file_loaded = GF_TRUE;
306306
}
@@ -824,6 +824,12 @@ GF_Err adts_dmx_process(GF_Filter *filter)
824824
}
825825

826826
if (!ctx->in_seek) {
827+
828+
if (sync_pos + offset + size > remain) {
829+
GF_LOG(GF_LOG_WARNING, GF_LOG_MEDIA, ("[ADTSDmx] truncated frame\n"));
830+
break;
831+
}
832+
827833
dst_pck = gf_filter_pck_new_alloc(ctx->opid, size, &output);
828834
if (!dst_pck) return GF_OUT_OF_MEM;
829835
if (ctx->src_pck) gf_filter_pck_merge_properties(ctx->src_pck, dst_pck);

0 commit comments

Comments
 (0)