aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-10 19:38:44 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-10 19:39:05 +0100
commit2d71f31df23910f18b17f17fa568b13fd5dcaf1a (patch)
tree3543f4cfbbbc60bb910b1943c9f1c5bcfadcc165
parentb53f89710b03c4c832bb03e4e132b1ace17fb4e4 (diff)
downloadffmpeg-2d71f31df23910f18b17f17fa568b13fd5dcaf1a.tar.gz
lag_read_prob_header: fix out of array access
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/lagarith.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c
index 6af0d09dc5..0611abfef4 100644
--- a/libavcodec/lagarith.c
+++ b/libavcodec/lagarith.c
@@ -158,8 +158,8 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb)
av_log(rac->avctx, AV_LOG_ERROR, "Invalid probability run encountered.\n");
return -1;
}
- if (prob > 257 - i)
- prob = 257 - i;
+ if (prob > 256 - i)
+ prob = 256 - i;
for (j = 0; j < prob; j++)
rac->prob[++i] = 0;
}