Commit 19c41969 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/wmavoice: Check remaining input in parse_packet_header()

Fixes: Infinite loop
Fixes: 18914/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAVOICE_fuzzer-5731902946541568

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 92455c8c
......@@ -1843,6 +1843,9 @@ static int parse_packet_header(WMAVoiceContext *s)
skip_bits(gb, 4); // packet sequence number
s->has_residual_lsps = get_bits1(gb);
do {
if (get_bits_left(gb) < 6 + s->spillover_bitsize)
return AVERROR_INVALIDDATA;
res = get_bits(gb, 6); // number of superframes per packet
// (minus first one if there is spillover)
n_superframes += res;
......
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