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
202 MCADemuxContext *m = s->priv_data;202 MCADemuxContext *m = s->priv_data;
203 int64_t ret = 0;203 int64_t ret = 0;
204 204
205 if (timestamp < 0)
206 timestamp = 0;
205 timestamp /= m->samples_per_block;207 timestamp /= m->samples_per_block;
208 if (timestamp >= m->block_count)
209 timestamp = m->block_count - 1;
206 ret = avio_seek(s->pb, m->data_start + timestamp * m->block_size *210 ret = avio_seek(s->pb, m->data_start + timestamp * m->block_size *
207 st->codecpar->channels, SEEK_SET);211 st->codecpar->channels, SEEK_SET);
208
209 if (ret < 0)212 if (ret < 0)
210 return ret;213 return ret;
211 214

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