mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-28 12:32:17 +02:00
qdm2: check that coding_method is valid before using it.
Fixes out of array reads. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
909a18f73b
commit
5ee008e01d
@ -795,6 +795,11 @@ static int synthfilt_build_sb_samples (QDM2Context *q, GetBitContext *gb, int le
|
||||
for (j = 0; j < 16; j++)
|
||||
sign_bits[j] = get_bits1 (gb);
|
||||
|
||||
if (q->coding_method[0][sb][0] <= 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "coding method invalid\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
for (j = 0; j < 64; j++)
|
||||
if (q->coding_method[1][sb][j] > q->coding_method[0][sb][j])
|
||||
q->coding_method[0][sb][j] = q->coding_method[1][sb][j];
|
||||
|
Loading…
x
Reference in New Issue
Block a user