Unified · Split
| @@ -446,7 +446,11 @@ static int read_seek(AVFormatContext *s, int stream_index, · 445 unmodified lines | |||
| 446 | BRSTMDemuxContext *b = s->priv_data; | 446 | BRSTMDemuxContext *b = s->priv_data; |
| 447 | int64_t ret = 0; | 447 | int64_t ret = 0; |
| 448 | 448 | ||
| 449 | if (timestamp < 0) | ||
| 450 | timestamp = 0; | ||
| 449 | timestamp /= b->samples_per_block; | 451 | timestamp /= b->samples_per_block; |
| 452 | if (timestamp >= b->block_count) | ||
| 453 | timestamp = b->block_count - 1; | ||
| 450 | ret = avio_seek(s->pb, b->data_start + timestamp * b->block_size * | 454 | ret = avio_seek(s->pb, b->data_start + timestamp * b->block_size * |
| 451 | st->codecpar->channels, SEEK_SET); | 455 | st->codecpar->channels, SEEK_SET); |
| 452 | if (ret < 0) | 456 | if (ret < 0) |