Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2018-02-07 02:20:01 +0300
committerMarton Balint <cus@passwd.hu>2018-03-02 00:03:53 +0300
commitc46e430c5bc790cd1b96f92a95a56b3da97f3f66 (patch)
tree6f4ca27303d5c1cba178a6875af14408f4ac7acc /libavformat/mxfdec.c
parent9492bb58eeea474158f9c523fd77395629117b57 (diff)
avformat/mxfdec: fix sorting of index segments
Fixes ticket #5320. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat/mxfdec.c')
-rw-r--r--libavformat/mxfdec.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 4f30877f6d..7abb047117 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1309,9 +1309,15 @@ static int mxf_get_sorted_table_segments(MXFContext *mxf, int *nb_sorted_segment
* We want the smallest values for the keys than what we currently have, unless this is the first such entry this time around.
* If we come across an entry with the same IndexStartPosition but larger IndexDuration, then we'll prefer it over the one we currently have.
*/
- if ((i == 0 || s->body_sid > last_body_sid || s->index_sid > last_index_sid || s->index_start_position > last_index_start) &&
- (best == -1 || s->body_sid < best_body_sid || s->index_sid < best_index_sid || s->index_start_position < best_index_start ||
- (s->index_start_position == best_index_start && s->index_duration > best_index_duration))) {
+ if ((i == 0 ||
+ s->body_sid > last_body_sid ||
+ s->body_sid == last_body_sid && s->index_sid > last_index_sid ||
+ s->body_sid == last_body_sid && s->index_sid == last_index_sid && s->index_start_position > last_index_start) &&
+ (best == -1 ||
+ s->body_sid < best_body_sid ||
+ s->body_sid == best_body_sid && s->index_sid < best_index_sid ||
+ s->body_sid == best_body_sid && s->index_sid == best_index_sid && s->index_start_position < best_index_start ||
+ s->body_sid == best_body_sid && s->index_sid == best_index_sid && s->index_start_position == best_index_start && s->index_duration > best_index_duration)) {
best = j;
best_body_sid = s->body_sid;
best_index_sid = s->index_sid;