mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avcodec/jpeg2000dec: Check bpno in decode_cblk()
Fixes: undefined shift Fixes: c409ef86f892335a0a164b5871174d5a/asan_heap-oob_1dff564_2159_162b7234616deab02b544410455eb07b.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit a85b02dcf70f62a6a433a607143f1f78fa5648bb) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
e5a4044771
commit
ea4d9cb3e5
@ -1489,6 +1489,10 @@ static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty,
|
|||||||
ff_mqc_initdec(&t1->mqc, cblk->data, 0, 1);
|
ff_mqc_initdec(&t1->mqc, cblk->data, 0, 1);
|
||||||
|
|
||||||
while (passno--) {
|
while (passno--) {
|
||||||
|
if (bpno < 0) {
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR, "bpno became negative\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
switch(pass_t) {
|
switch(pass_t) {
|
||||||
case 0:
|
case 0:
|
||||||
decode_sigpass(t1, width, height, bpno + 1, bandpos,
|
decode_sigpass(t1, width, height, bpno + 1, bandpos,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user