You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-29 05:57:37 +02:00
avcodec/exr: Check that DWA has 3 channels
The implementation hardcodes access to 3 channels, so we need to check that
Fixes: out of array access
Fixes: BIGSLEEP-445394503-crash.exr
Found-by: Google Big Sleep
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7896cc67c1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -999,6 +999,11 @@ static int dwa_uncompress(const EXRContext *s, const uint8_t *src, int compresse
|
||||
if (version != 2)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if (s->nb_channels < 3) {
|
||||
avpriv_request_sample(s->avctx, "Gray DWA");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
lo_usize = AV_RL64(src + 8);
|
||||
lo_size = AV_RL64(src + 16);
|
||||
ac_size = AV_RL64(src + 24);
|
||||
|
||||
Reference in New Issue
Block a user