History

avformat/brstm: clip timestamp when seeking into acceptable range

Paul B Mahol committed 6 years ago

Commit f4b84d81 parent 38be4701 file · +4 −0Browse files

Unified · Split

libavformat/brstm.c+4−0
@@ -446,7 +446,11 @@ static int read_seek(AVFormatContext *s, int stream_index, · 445 unmodified lines
446446 BRSTMDemuxContext *b = s->priv_data;
447447 int64_t ret = 0;
448448
449+ if (timestamp < 0)
450+ timestamp = 0;
449451 timestamp /= b->samples_per_block;
452+ if (timestamp >= b->block_count)
453+ timestamp = b->block_count - 1;
450454 ret = avio_seek(s->pb, b->data_start + timestamp * b->block_size *
451455 st->codecpar->channels, SEEK_SET);
452456 if (ret < 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