This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch release/8.0 in repository ffmpeg.
commit 64538ca0c4329c954a8d8cd2579d752d64fe8767 Author: Michael Niedermayer <[email protected]> AuthorDate: Thu Jun 4 21:19:18 2026 +0200 Commit: Michael Niedermayer <[email protected]> CommitDate: Wed Jun 17 05:19:54 2026 +0200 avformat/mpegts: use av_fast_realloc() for prg Fixes: Timeout Fixes: 514855073/clusterfuzz-testcase-minimized-ffmpeg_dem_MPEGTS_fuzzer-5074757044469760 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit f7e6a8ade5b695d52e8161df8687e806c2e4d924) Signed-off-by: Michael Niedermayer <[email protected]> --- libavformat/mpegts.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 41785dd0cd..077db4d779 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -173,6 +173,7 @@ struct MpegTSContext { /* scan context */ /** structure to keep track of Program->pids mapping */ unsigned int nb_prg; + unsigned int prg_size; ///< allocated size of prg in bytes struct Program *prg; int8_t crc_validity[NB_PID_MAX]; @@ -316,17 +317,26 @@ static void clear_programs(MpegTSContext *ts) { av_freep(&ts->prg); ts->nb_prg = 0; + ts->prg_size = 0; } static struct Program * add_program(MpegTSContext *ts, unsigned int programid) { struct Program *p = get_program(ts, programid); + struct Program *tmp = NULL; + size_t new_prg_size; if (p) return p; - if (av_reallocp_array(&ts->prg, ts->nb_prg + 1, sizeof(*ts->prg)) < 0) { - ts->nb_prg = 0; + + if (!av_size_mult(ts->nb_prg + 1, sizeof(*ts->prg), &new_prg_size)) + tmp = av_fast_realloc(ts->prg, &ts->prg_size,new_prg_size); + if (!tmp) { + av_freep(&ts->prg); + ts->nb_prg = 0; + ts->prg_size = 0; return NULL; } + ts->prg = tmp; p = &ts->prg[ts->nb_prg]; p->id = programid; clear_program(p); _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
