mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-06 15:21:15 +00:00
avformat/mpegts: use actually read packet size in mpegts_resync special case
Fixes: infinite loop Fixes: 37986/clusterfuzz-testcase-minimized-ffmpeg_dem_MPEGTSRAW_fuzzer-5292311517462528 - Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
6e859d2bdb
commit
83b2e4c8f1
@ -2875,8 +2875,8 @@ static int mpegts_resync(AVFormatContext *s, int seekback, const uint8_t *curren
|
|||||||
int64_t back = FFMIN(seekback, pos);
|
int64_t back = FFMIN(seekback, pos);
|
||||||
|
|
||||||
//Special case for files like 01c56b0dc1.ts
|
//Special case for files like 01c56b0dc1.ts
|
||||||
if (current_packet[0] == 0x80 && current_packet[12] == 0x47) {
|
if (current_packet[0] == 0x80 && current_packet[12] == 0x47 && pos >= TS_PACKET_SIZE) {
|
||||||
avio_seek(pb, 12 - back, SEEK_CUR);
|
avio_seek(pb, 12 - TS_PACKET_SIZE, SEEK_CUR);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user