Skip to content

Commit fa19fbc

Browse files
committed
avformat/movenc: Write version 2 of audio atom if channels is not known
The version 1 needs the channel count and would divide by 0 Fixes: division by 0 Fixes: fpe_movenc.c_1108_1.ogg Fixes: fpe_movenc.c_1108_2.ogg Fixes: fpe_movenc.c_1108_3.wav Found-by: #CHEN HONGXU# <HCHEN017@e.ntu.edu.sg> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
1 parent 6cc6b61 commit fa19fbc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: libavformat/movenc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ static int mov_write_audio_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContex
10221022
uint32_t tag = track->tag;
10231023

10241024
if (track->mode == MODE_MOV) {
1025-
if (track->timescale > UINT16_MAX) {
1025+
if (track->timescale > UINT16_MAX || !track->par->channels) {
10261026
if (mov_get_lpcm_flags(track->par->codec_id))
10271027
tag = AV_RL32("lpcm");
10281028
version = 2;

0 commit comments

Comments
 (0)