aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2024-01-29 19:58:18 +0100
committerMarton Balint <cus@passwd.hu>2024-02-09 23:47:24 +0100
commit3d3cad7483785191b99557c78d5a4a551088c549 (patch)
treec51b3ed21339a8454bd5dab1ad953b6e96915e7c
parent90adef99cab46ed1791c8096ac2ac0b89f67a266 (diff)
downloadffmpeg-3d3cad7483785191b99557c78d5a4a551088c549.tar.gz
avformat/mov_chan: do not assume channels are in native order
Existing code could have caused wrong channel order signalling or reduced channel count if a channel designation appeared multiple times. This is actually an old bug, but the conversion to the new channel layout API made it visible, because now the code overrides the proper channel count with the one calculated from the mask. Signed-off-by: Marton Balint <cus@passwd.hu>
-rw-r--r--libavformat/mov_chan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
index f3d51899e1..5cb2de3820 100644
--- a/libavformat/mov_chan.c
+++ b/libavformat/mov_chan.c
@@ -530,7 +530,7 @@ int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st,
size -= 20;
if (layout_tag == 0) {
uint64_t mask_incr = mov_get_channel_mask(label);
- if (mask_incr == 0) {
+ if (mask_incr == 0 || mask_incr <= label_mask) {
label_mask = 0;
break;
}