Browse Source

Merge commit '59480abce7e4238e22b3a4a904a9fe6abf4e4188'

* commit '59480abce7e4238e22b3a4a904a9fe6abf4e4188':
  alac: Do bounds checking of lpc_order read from the bitstream

See: fd4f4923cc
Merged-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.1
Michael Niedermayer 12 years ago
parent
commit
9e58d46edf
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavcodec/alac.c

+ 3
- 0
libavcodec/alac.c View File

@@ -320,6 +320,9 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
rice_history_mult[ch] = get_bits(&alac->gb, 3); rice_history_mult[ch] = get_bits(&alac->gb, 3);
lpc_order[ch] = get_bits(&alac->gb, 5); lpc_order[ch] = get_bits(&alac->gb, 5);


if (lpc_order[ch] >= alac->max_samples_per_frame)
return AVERROR_INVALIDDATA;

/* read the predictor table */ /* read the predictor table */
for (i = lpc_order[ch] - 1; i >= 0; i--) for (i = lpc_order[ch] - 1; i >= 0; i--)
lpc_coefs[ch][i] = get_sbits(&alac->gb, 16); lpc_coefs[ch][i] = get_sbits(&alac->gb, 16);


Loading…
Cancel
Save