Skip to content
Snippets Groups Projects
Commit dd5208aa authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Michael Niedermayer
Browse files

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: default avatarSasi Inguva <isasi@google.com>
Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
parent 909e00ae
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment