mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-22 05:40:27 +08:00
libavcodec/wmalosslessdec: Check the remaining bits
Fixes assertion failure
Fixes: 24ebfda03228b5cc1ef792608cfba458/signal_sigabrt_7ffff6ae7c37_6473_3fa8a111dbc752b1a7c411c5ab79aaa4.wma
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 67318187fb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -1277,6 +1277,11 @@ static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr,
|
||||
}
|
||||
}
|
||||
|
||||
if (remaining_bits(s, gb) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Overread %d\n", -remaining_bits(s, gb));
|
||||
s->packet_loss = 1;
|
||||
}
|
||||
|
||||
if (s->packet_done && !s->packet_loss &&
|
||||
remaining_bits(s, gb) > 0) {
|
||||
/* save the rest of the data so that it can be decoded
|
||||
|
||||
Reference in New Issue
Block a user