You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-16 22:42:38 +02:00
avcodec/alsdec: Check r to prevent out of array read
No testcase known
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c36fc857b5
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@ -767,6 +767,11 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
|
|||||||
|
|
||||||
r = get_unary(gb, 0, 4);
|
r = get_unary(gb, 0, 4);
|
||||||
c = get_bits(gb, 2);
|
c = get_bits(gb, 2);
|
||||||
|
if (r >= 4) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "r overflow\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
bd->ltp_gain[2] = ltp_gain_values[r][c];
|
bd->ltp_gain[2] = ltp_gain_values[r][c];
|
||||||
|
|
||||||
bd->ltp_gain[3] = decode_rice(gb, 2) << 3;
|
bd->ltp_gain[3] = decode_rice(gb, 2) << 3;
|
||||||
|
Reference in New Issue
Block a user