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