This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new f7e6a8ade5 avformat/mpegts: use av_fast_realloc() for prg
f7e6a8ade5 is described below
commit f7e6a8ade5b695d52e8161df8687e806c2e4d924
Author: Michael Niedermayer <[email protected]>
AuthorDate: Thu Jun 4 21:19:18 2026 +0200
Commit: michaelni <[email protected]>
CommitDate: Mon Jun 15 00:25:34 2026 +0000
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]>
---
libavformat/mpegts.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index f213e63759..076020509d 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -185,6 +185,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];
@@ -332,17 +333,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]