]> git.ipfire.org Git - thirdparty/grub.git/commit
video/readers/jpeg: Don't decode data before start of stream
authorDaniel Axtens <dja@axtens.net>
Fri, 15 Jan 2021 03:06:46 +0000 (14:06 +1100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 2 Mar 2021 14:54:18 +0000 (15:54 +0100)
commit8338a8238f08d9f3ae4c2ddfff0603eff80af9e2
tree8f575e2c41272ca990272d10c7b43bd62beb98b7
parent34b85a6e07014383ddcad09f99ff239ad752dd1a
video/readers/jpeg: Don't decode data before start of stream

When a start of stream marker is encountered, we call grub_jpeg_decode_sos()
which allocates space for a bitmap.

When a restart marker is encountered, we call grub_jpeg_decode_data() which
then fills in that bitmap.

If we get a restart marker before the start of stream marker, we will
attempt to write to a bitmap_ptr that hasn't been allocated. Catch this
and bail out. This fixes an attempt to write to NULL.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/video/readers/jpeg.c