[FFmpeg-cvslog] avformat/mov_chan: do not assume channels are in native order

Marton Balint git at videolan.org
Mon Feb 12 00:20:02 EET 2024


ffmpeg | branch: release/6.0 | Marton Balint <cus at passwd.hu> | Mon Jan 29 19:58:18 2024 +0100| [ae7cd2fc02a638f8d1d8f731e38481106782db9a] | committer: Marton Balint

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 at passwd.hu>
(cherry picked from commit 3d3cad7483785191b99557c78d5a4a551088c549)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ae7cd2fc02a638f8d1d8f731e38481106782db9a
---

 libavformat/mov_chan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
index f66bf0df7f..51481cc9cf 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;
             }



More information about the ffmpeg-cvslog mailing list