mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-13 18:55:08 +00:00
mjpegdec: check h/v_count.
Fixes FPE Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
46c7842994
commit
08c37a10e9
@ -275,6 +275,10 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||
s->h_max = s->h_count[i];
|
||||
if (s->v_count[i] > s->v_max)
|
||||
s->v_max = s->v_count[i];
|
||||
if (!s->h_count[i] || !s->v_count[i]) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "h/v_count is 0\n");
|
||||
return -1;
|
||||
}
|
||||
s->quant_index[i] = get_bits(&s->gb, 8);
|
||||
if (s->quant_index[i] >= 4)
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user