jpegls: check the scan offset
Prevent an out of array bound write.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit abad374909
)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Conflicts:
libavcodec/jpeglsdec.c
This commit is contained in:

committed by
Reinhard Tartler

parent
582aec4989
commit
0af5a774eb
@@ -289,6 +289,10 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transfor
|
||||
av_dlog(s->avctx, "JPEG params: ILV=%i Pt=%i BPP=%i, scan = %i\n",
|
||||
ilv, point_transform, s->bits, s->cur_scan);
|
||||
if(ilv == 0) { /* separate planes */
|
||||
if (s->cur_scan > s->nb_components) {
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto end;
|
||||
}
|
||||
off = s->cur_scan - 1;
|
||||
stride = (s->nb_components > 1) ? 3 : 1;
|
||||
width = s->width * stride;
|
||||
|
Reference in New Issue
Block a user