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: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2015-07-10 16:54:51 +02:00
parent 3526a120f9
commit b1e242bc56

View File

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