Browse Source

shorten: Fix out-of-array read

pred_order == FF_ARRAY_ELEMS(fixed_coeffs) is invalid too.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
tags/n2.1
Tim Walker Luca Barbato 12 years ago
parent
commit
5f5ada3dbf
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/shorten.c

+ 1
- 1
libavcodec/shorten.c View File

@@ -303,7 +303,7 @@ static int decode_subframe_lpc(ShortenContext *s, int command, int channel,
} else {
/* fixed LPC coeffs */
pred_order = command;
if (pred_order > FF_ARRAY_ELEMS(fixed_coeffs)) {
if (pred_order >= FF_ARRAY_ELEMS(fixed_coeffs)) {
av_log(s->avctx, AV_LOG_ERROR, "invalid pred_order %d\n",
pred_order);
return AVERROR_INVALIDDATA;


Loading…
Cancel
Save