History

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

Michael Niedermayer committed 4 years ago

Commit ffc87721 parent 5d6cdb01 file · +6 −4Browse files

Showing the changes to libavformat (1 of 1 file). Show all

Unified · Split

libavformat/asfdec_f.c+6−4
@@ -1217,10 +1217,12 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt) · 1216 unmodified lines
12171217 if ((ret = av_new_packet(&asf_st->pkt, asf_st->packet_obj_size)) < 0)
12181218 return ret;
12191219 asf_st->seq = asf->packet_seq;
1220− if (asf->ts_is_pts) {
1221− asf_st->pkt.pts = asf->packet_frag_timestamp - asf->hdr.preroll;
1222− } else
1223− asf_st->pkt.dts = asf->packet_frag_timestamp - asf->hdr.preroll;
1220+ if (asf->packet_frag_timestamp != AV_NOPTS_VALUE) {
1221+ if (asf->ts_is_pts) {
1222+ asf_st->pkt.pts = asf->packet_frag_timestamp - asf->hdr.preroll;
1223+ } else
1224+ asf_st->pkt.dts = asf->packet_frag_timestamp - asf->hdr.preroll;
1225+ }
12241226 asf_st->pkt.stream_index = asf->stream_index;
12251227 asf_st->pkt.pos = asf_st->packet_pos = asf->packet_pos;
12261228 asf_st->pkt_clean = 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t