[FFmpeg-cvslog] avformat/movenc: fix writing reserved bits in EC3SpecificBox

James Almer git at videolan.org
Fri Jun 6 03:49:54 EEST 2025


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Thu Jun  5 18:24:07 2025 -0300| [17729aa80c618dddb83276effa0e0bd0c1db3b70] | committer: James Almer

avformat/movenc: fix writing reserved bits in EC3SpecificBox

As described in section F.6.1 from ETSI TS 102 366.

Found-by: nyanmisaka
Reviewed-by: Baptiste Coudurier <baptiste.coudurier at gmail.com>
Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavformat/movenc.c         | 4 ++--
 tests/ref/fate/copy-trac3074 | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 402611e81e..0db0cb198b 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -614,7 +614,7 @@ static int mov_write_eac3_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
     }
 
     info = track->eac3_priv;
-    size = 2 + ((34 * (info->num_ind_sub + 1) + 7) >> 3);
+    size = 2 + ((32 * (info->num_ind_sub + 1) + 7) >> 3);
     buf = av_malloc(size);
     if (!buf) {
         return AVERROR(ENOMEM);
@@ -631,7 +631,7 @@ static int mov_write_eac3_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
         put_bits(&pbc, 3, info->substream[i].bsmod);
         put_bits(&pbc, 3, info->substream[i].acmod);
         put_bits(&pbc, 1, info->substream[i].lfeon);
-        put_bits(&pbc, 5, 0); /* reserved */
+        put_bits(&pbc, 3, 0); /* reserved */
         put_bits(&pbc, 4, info->substream[i].num_dep_sub);
         if (!info->substream[i].num_dep_sub) {
             put_bits(&pbc, 1, 0); /* reserved */
diff --git a/tests/ref/fate/copy-trac3074 b/tests/ref/fate/copy-trac3074
index 53ba27e920..9ed42c8d8d 100644
--- a/tests/ref/fate/copy-trac3074
+++ b/tests/ref/fate/copy-trac3074
@@ -1,5 +1,5 @@
-36fcc0a62695bcf93068fcfe68283ee9 *tests/data/fate/copy-trac3074.mp4
-334016 tests/data/fate/copy-trac3074.mp4
+5b4a3ed9de3b2a92e5dcb127bca12e68 *tests/data/fate/copy-trac3074.mp4
+334015 tests/data/fate/copy-trac3074.mp4
 #tb 0: 1/48000
 #media_type 0: audio
 #codec_id 0: eac3



More information about the ffmpeg-cvslog mailing list