1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

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@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2025-06-05 18:24:07 -03:00
parent a4c1a5b084
commit 17729aa80c
2 changed files with 4 additions and 4 deletions

View File

@ -614,7 +614,7 @@ static int mov_write_eac3_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
} }
info = track->eac3_priv; 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); buf = av_malloc(size);
if (!buf) { if (!buf) {
return AVERROR(ENOMEM); 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].bsmod);
put_bits(&pbc, 3, info->substream[i].acmod); put_bits(&pbc, 3, info->substream[i].acmod);
put_bits(&pbc, 1, info->substream[i].lfeon); 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); put_bits(&pbc, 4, info->substream[i].num_dep_sub);
if (!info->substream[i].num_dep_sub) { if (!info->substream[i].num_dep_sub) {
put_bits(&pbc, 1, 0); /* reserved */ put_bits(&pbc, 1, 0); /* reserved */

View File

@ -1,5 +1,5 @@
36fcc0a62695bcf93068fcfe68283ee9 *tests/data/fate/copy-trac3074.mp4 5b4a3ed9de3b2a92e5dcb127bca12e68 *tests/data/fate/copy-trac3074.mp4
334016 tests/data/fate/copy-trac3074.mp4 334015 tests/data/fate/copy-trac3074.mp4
#tb 0: 1/48000 #tb 0: 1/48000
#media_type 0: audio #media_type 0: audio
#codec_id 0: eac3 #codec_id 0: eac3