Skip to content

Commit 17729aa

Browse files
committed
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 <[email protected]> Signed-off-by: James Almer <[email protected]>
1 parent a4c1a5b commit 17729aa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libavformat/movenc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ static int mov_write_eac3_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
614614
}
615615

616616
info = track->eac3_priv;
617-
size = 2 + ((34 * (info->num_ind_sub + 1) + 7) >> 3);
617+
size = 2 + ((32 * (info->num_ind_sub + 1) + 7) >> 3);
618618
buf = av_malloc(size);
619619
if (!buf) {
620620
return AVERROR(ENOMEM);
@@ -631,7 +631,7 @@ static int mov_write_eac3_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
631631
put_bits(&pbc, 3, info->substream[i].bsmod);
632632
put_bits(&pbc, 3, info->substream[i].acmod);
633633
put_bits(&pbc, 1, info->substream[i].lfeon);
634-
put_bits(&pbc, 5, 0); /* reserved */
634+
put_bits(&pbc, 3, 0); /* reserved */
635635
put_bits(&pbc, 4, info->substream[i].num_dep_sub);
636636
if (!info->substream[i].num_dep_sub) {
637637
put_bits(&pbc, 1, 0); /* reserved */

tests/ref/fate/copy-trac3074

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
36fcc0a62695bcf93068fcfe68283ee9 *tests/data/fate/copy-trac3074.mp4
2-
334016 tests/data/fate/copy-trac3074.mp4
1+
5b4a3ed9de3b2a92e5dcb127bca12e68 *tests/data/fate/copy-trac3074.mp4
2+
334015 tests/data/fate/copy-trac3074.mp4
33
#tb 0: 1/48000
44
#media_type 0: audio
55
#codec_id 0: eac3

0 commit comments

Comments
 (0)