mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
avformat/mov: Fix ctts_index calculation
An index should never be equal to the count. Hence we must make sure *ctts_index < ctts_count. Reviewed-by: Sasi Inguva <isasi@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
909e00ae81
commit
dd5208aaf5
@ -3132,7 +3132,7 @@ static int find_prev_closest_index(AVStream *st,
|
||||
}
|
||||
}
|
||||
|
||||
while (*index >= 0 && (*ctts_index) >= 0) {
|
||||
while (*index >= 0 && (*ctts_index) >= 0 && (*ctts_index) < ctts_count) {
|
||||
// Find a "key frame" with PTS <= timestamp_pts (So that we can decode B-frames correctly).
|
||||
// No need to add dts_shift to the timestamp here becase timestamp_pts has already been
|
||||
// compensated by dts_shift above.
|
||||
|
Loading…
Reference in New Issue
Block a user