Browse Source

avcodec/wmaprodec: check that there are input bits left in decode_subframe_length()

Fixes infinite loop
Fixes Ticket2987

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.1
Michael Niedermayer 12 years ago
parent
commit
c99d27287d
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavcodec/wmaprodec.c

+ 3
- 0
libavcodec/wmaprodec.c View File

@@ -500,6 +500,9 @@ static int decode_subframe_length(WMAProDecodeCtx *s, int offset)
if (offset == s->samples_per_frame - s->min_samples_per_subframe)
return s->min_samples_per_subframe;

if (get_bits_left(&s->gb) < 1)
return AVERROR_INVALIDDATA;

/** 1 bit indicates if the subframe is of maximum length */
if (s->max_subframe_len_bit) {
if (get_bits1(&s->gb))


Loading…
Cancel
Save