Commit b1e242bc authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/g2meet: Check R/G/B values in epic_decode_pixel_pred()

Fixes: asan_double-free_d34593_861_smp3.wmv

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 3526a120
......@@ -555,6 +555,11 @@ static uint32_t epic_decode_pixel_pred(ePICContext *dc, int x, int y,
B = ((pred >> B_shift) & 0xFF) - TOSIGNED(delta);
}
if (R<0 || G<0 || B<0) {
av_log(NULL, AV_LOG_ERROR, "RGB %d %d %d is out of range\n", R, G, B);
return 0;
}
return (R << R_shift) | (G << G_shift) | (B << B_shift);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment