mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
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/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 19c41969b2
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
45eef1be3a
commit
43fe503107
@ -1892,6 +1892,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)
|
||||
if (get_bits_left(gb) < 6 * (res == 0x3F) + s->spillover_bitsize)
|
||||
|
Loading…
Reference in New Issue
Block a user