History

avformat/mca: clip timestamp when seeking into acceptable range

Paul B Mahol committed 6 years ago

Commit 38be4701 parent d58f8fd1 file · +4 −1Browse files

Unified · Split

libavformat/mca.c+4−1
@@ -202,10 +202,13 @@ static int read_seek(AVFormatContext *s, int stream_index, · 201 unmodified lines
202202 MCADemuxContext *m = s->priv_data;
203203 int64_t ret = 0;
204204
205+ if (timestamp < 0)
206+ timestamp = 0;
205207 timestamp /= m->samples_per_block;
208+ if (timestamp >= m->block_count)
209+ timestamp = m->block_count - 1;
206210 ret = avio_seek(s->pb, m->data_start + timestamp * m->block_size *
207211 st->codecpar->channels, SEEK_SET);
208−
209212 if (ret < 0)
210213 return ret;
211214

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