1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avformat/asfdec_f: Check packet_frag_timestamp

Fixes: signed integer overflow: -9223372036854775808 - 4607 cannot be represented in type 'long'
Fixes: 45685/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5280102802391040

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ffc8772150)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2022-03-20 23:13:16 +01:00
parent a6df0d5140
commit 8ea01dca10
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -1321,10 +1321,12 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
if ((ret = av_new_packet(&asf_st->pkt, asf_st->packet_obj_size)) < 0)
return ret;
asf_st->seq = asf->packet_seq;
if (asf->ts_is_pts) {
asf_st->pkt.pts = asf->packet_frag_timestamp - asf->hdr.preroll;
} else
asf_st->pkt.dts = asf->packet_frag_timestamp - asf->hdr.preroll;
if (asf->packet_frag_timestamp != AV_NOPTS_VALUE) {
if (asf->ts_is_pts) {
asf_st->pkt.pts = asf->packet_frag_timestamp - asf->hdr.preroll;
} else
asf_st->pkt.dts = asf->packet_frag_timestamp - asf->hdr.preroll;
}
asf_st->pkt.stream_index = asf->stream_index;
asf_st->pkt.pos = asf_st->packet_pos = asf->packet_pos;
asf_st->pkt_clean = 0;