mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-11 17:30:00 +01:00
avcodec/exr: Check for pixel type consistency in DWA
Fixes: out of array access
Fixes: BIGSLEEP-436511754/testcase.exr
Found-by: Google Big Sleep
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0469d68acb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -2064,6 +2064,16 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture,
|
||||
for (int i = 0; i < 4; i++)
|
||||
s->channel_offsets[i] *= 2;
|
||||
}
|
||||
if (s->compression == EXR_DWAA ||
|
||||
s->compression == EXR_DWAB) {
|
||||
for (int i = 0; i<s->nb_channels; i++) {
|
||||
EXRChannel *channel = &s->channels[i];
|
||||
if (channel->pixel_type != s->pixel_type) {
|
||||
avpriv_request_sample(s->avctx, "mixed pixel type DWA");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (s->pixel_type) {
|
||||
case EXR_FLOAT:
|
||||
|
||||
Reference in New Issue
Block a user