Browse Source

Avoid a deadlock when decoding wma.

Fixes ticket #2925.
tags/n2.1
Carl Eugen Hoyos 12 years ago
parent
commit
ec8a4841f7
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavcodec/wmadec.c

+ 4
- 0
libavcodec/wmadec.c View File

@@ -512,6 +512,10 @@ static int wma_decode_block(WMACodecContext *s)
coef escape coding */ coef escape coding */
total_gain = 1; total_gain = 1;
for(;;) { for(;;) {
if (get_bits_left(&s->gb) < 7) {
av_log(s->avctx, AV_LOG_ERROR, "total_gain overread\n");
return AVERROR_INVALIDDATA;
}
a = get_bits(&s->gb, 7); a = get_bits(&s->gb, 7);
total_gain += a; total_gain += a;
if (a != 127) if (a != 127)


Loading…
Cancel
Save