Browse Source

dcadec: Validate the lfe parameter

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
tags/n2.1
Martin Storsjö 12 years ago
parent
commit
a9d50bb578
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/dcadec.c

+ 5
- 0
libavcodec/dcadec.c View File

@@ -580,6 +580,11 @@ static int dca_parse_frame_header(DCAContext *s)
s->lfe = get_bits(&s->gb, 2);
s->predictor_history = get_bits(&s->gb, 1);

if (s->lfe > 2) {
av_log(s->avctx, AV_LOG_ERROR, "Invalid LFE value: %d\n", s->lfe);
return AVERROR_INVALIDDATA;
}

/* TODO: check CRC */
if (s->crc_present)
s->header_crc = get_bits(&s->gb, 16);


Loading…
Cancel
Save