1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-03-23 04:24:35 +02:00

avcodec/mjpegdec: check that component linesize is always valid

This commit is contained in:
Paul B Mahol 2022-12-08 23:49:33 +01:00
parent a9d15d43eb
commit 55753fc712

View File

@ -1512,7 +1512,7 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
"error y=%d x=%d\n", mb_y, mb_x);
return AVERROR_INVALIDDATA;
}
if (ptr) {
if (ptr && linesize[c]) {
s->idsp.idct_put(ptr, linesize[c], s->block);
if (s->bits & 7)
shift_output(s, ptr, linesize[c]);