Skip to content

Commit

Permalink
ac3dmx: add remain size check (fixes #2627)
Browse files Browse the repository at this point in the history
  • Loading branch information
aureliendavid committed Oct 11, 2023
1 parent 28c4eb1 commit 5692dc7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/filters/reframe_ac3.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ GF_Err ac3dmx_process(GF_Filter *filter)
u8 *start;
u32 pck_size, remain, prev_pck_size;
u64 cts;

restart:
cts = GF_FILTER_NO_TS;

Expand Down Expand Up @@ -480,10 +480,10 @@ GF_Err ac3dmx_process(GF_Filter *filter)
cts = GF_FILTER_NO_TS;
}

if (!ctx->in_seek) {
if (!ctx->in_seek && remain >= ctx->hdr.framesize) {
dst_pck = gf_filter_pck_new_alloc(ctx->opid, ctx->hdr.framesize, &output);
if (!dst_pck) return GF_OUT_OF_MEM;

if (ctx->src_pck) gf_filter_pck_merge_properties(ctx->src_pck, dst_pck);

memcpy(output, sync, ctx->hdr.framesize);
Expand Down

0 comments on commit 5692dc7

Please sign in to comment.