1
0
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:
Michael Niedermayer
2025-09-19 00:18:30 +02:00
parent 39d89c3917
commit 50b3fa8dbe

View File

@@ -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);