Commit 790e6fea authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/movenc: Check input sample count

Fixes: division by 0
Fixes: fpe_movenc.c_199_1.wav
Fixes: fpe_movenc.c_199_2.wav
Fixes: fpe_movenc.c_199_3.wav
Fixes: fpe_movenc.c_199_4.wav
Fixes: fpe_movenc.c_199_5.wav
Fixes: fpe_movenc.c_199_6.wav
Fixes: fpe_movenc.c_199_7.wav
Found-by: 's avatar#CHEN HONGXU# <HCHEN017@e.ntu.edu.sg>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3a2d21bc)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 4ead5a94
...@@ -4437,6 +4437,11 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -4437,6 +4437,11 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
else else
samples_in_chunk = 1; samples_in_chunk = 1;
if (samples_in_chunk < 1) {
av_log(s, AV_LOG_ERROR, "fatal error, input packet contains no samples\n");
return AVERROR_PATCHWELCOME;
}
/* copy extradata if it exists */ /* copy extradata if it exists */
if (trk->vos_len == 0 && enc->extradata_size > 0 && if (trk->vos_len == 0 && enc->extradata_size > 0 &&
!TAG_IS_AVCI(trk->tag) && !TAG_IS_AVCI(trk->tag) &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment