diff options
author | Michael Niedermayer <[email protected]> | 2020-11-04 01:06:47 +0100 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2021-02-02 14:18:21 +0100 |
commit | 0040f0f11b9f57afa340a376ad70d7f32a32b996 (patch) | |
tree | a6ffae619889e02901bd69a7231e0f07e172d0da | |
parent | 14e4f69fbae70048dfacb48d2bd3a7837a55242a (diff) |
avformat/mpegts: Limit copied data to space
Fixes: out of array access
Fixes: 26816/clusterfuzz-testcase-minimized-ffmpeg_dem_MPEGTSRAW_fuzzer-6282861159907328.fuzz
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Marton Balint <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit 79cf7c71910a69b9f22b3e7ee6508a771262abaf)
Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r-- | libavformat/mpegts.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 1da81a0fe6..ccef5c45ad 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -3165,7 +3165,7 @@ static int mpegts_raw_read_packet(AVFormatContext *s, AVPacket *pkt) return ret; } if (data != pkt->data) - memcpy(pkt->data, data, ts->raw_packet_size); + memcpy(pkt->data, data, TS_PACKET_SIZE); finished_reading_packet(s, ts->raw_packet_size); if (ts->mpeg2ts_compute_pcr) { /* compute exact PCR for each packet */ |