mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-10 00:30:14 +00:00
avformat/mpegts: Reset local nb_prg on add_program() failure
add_program() will deallocate the whole array on failure so we must clear nb_prgs Fixes: null pointer dereference Fixes: crash-35a3b39ddcc5babeeb005b7399a3a1217c8781bc Found-by: Catena cyber Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
c0532f5579
commit
cb9752d897
@ -2603,7 +2603,8 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
|
||||
FFSWAP(struct Program, ts->prg[nb_prg], ts->prg[prg_idx]);
|
||||
if (prg_idx >= nb_prg)
|
||||
nb_prg++;
|
||||
}
|
||||
} else
|
||||
nb_prg = 0;
|
||||
}
|
||||
}
|
||||
ts->nb_prg = nb_prg;
|
||||
|
Loading…
Reference in New Issue
Block a user