aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/wmavoice.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c
index 5dd9b3dbb7..5f8987ac38 100644
--- a/libavcodec/wmavoice.c
+++ b/libavcodec/wmavoice.c
@@ -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;