Skip to content

Commit

Permalink
rfadts: add size guard on dmx (#2400)
Browse files Browse the repository at this point in the history
  • Loading branch information
aureliendavid committed Feb 16, 2023
1 parent be9f8d3 commit b964fe4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/filters/reframe_adts.c
Expand Up @@ -300,7 +300,7 @@ static void adts_dmx_check_dur(GF_Filter *filter, GF_ADTSDmxCtx *ctx)
}
}
}

p = gf_filter_pid_get_property(ctx->ipid, GF_PROP_PID_FILE_CACHED);
if (p && p->value.boolean) ctx->file_loaded = GF_TRUE;
}
Expand Down Expand Up @@ -824,6 +824,12 @@ GF_Err adts_dmx_process(GF_Filter *filter)
}

if (!ctx->in_seek) {

if (sync_pos + offset + size > remain) {
GF_LOG(GF_LOG_WARNING, GF_LOG_MEDIA, ("[ADTSDmx] truncated frame\n"));
break;
}

dst_pck = gf_filter_pck_new_alloc(ctx->opid, size, &output);
if (!dst_pck) return GF_OUT_OF_MEM;
if (ctx->src_pck) gf_filter_pck_merge_properties(ctx->src_pck, dst_pck);
Expand Down

0 comments on commit b964fe4

Please sign in to comment.