Commit 2d71f31d authored by Michael Niedermayer's avatar Michael Niedermayer

lag_read_prob_header: fix out of array access

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b53f8971
...@@ -158,8 +158,8 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) ...@@ -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"); av_log(rac->avctx, AV_LOG_ERROR, "Invalid probability run encountered.\n");
return -1; return -1;
} }
if (prob > 257 - i) if (prob > 256 - i)
prob = 257 - i; prob = 256 - i;
for (j = 0; j < prob; j++) for (j = 0; j < prob; j++)
rac->prob[++i] = 0; rac->prob[++i] = 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment