aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-07-08 00:16:42 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-07-16 19:02:12 +0200
commitfd53179f4a71e0acd807bdfff112a55e204fa4ba (patch)
tree21632ded31377b7d4e356925d36a1a55c2231d66
parent5db47b3983ef23c1676ddcd7a88c22b5f38b0230 (diff)
downloadffmpeg-fd53179f4a71e0acd807bdfff112a55e204fa4ba.tar.gz
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> (cherry picked from commit fa19fbcf712a6a6cc5a5cfdc3254a97b9bce6582) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/movenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index ef76c6a5a5..415637d46f 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1018,7 +1018,7 @@ static int mov_write_audio_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContex
uint32_t tag = track->tag;
if (track->mode == MODE_MOV) {
- if (track->timescale > UINT16_MAX) {
+ if (track->timescale > UINT16_MAX || !track->par->channels) {
if (mov_get_lpcm_flags(track->par->codec_id))
tag = AV_RL32("lpcm");
version = 2;