]> git.ipfire.org Git - thirdparty/grub.git/commit
video/readers/jpeg: Catch files with unsupported quantization or Huffman tables
authorDaniel Axtens <dja@axtens.net>
Fri, 15 Jan 2021 01:57:04 +0000 (12:57 +1100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 2 Mar 2021 14:54:18 +0000 (15:54 +0100)
commit693989598fd38c3c0b2a928f4f64865b5681762f
treeebb7e1e479941e36b2c6dd2c77700a2b2069edb0
parentf41f0af48ab7f7c135aac17ac862c30bde0bbab7
video/readers/jpeg: Catch files with unsupported quantization or Huffman tables

Our decoder only supports 2 quantization tables. If a file asks for
a quantization table with index > 1, reject it.

Similarly, our decoder only supports 4 Huffman tables. If a file asks
for a Huffman table with index > 3, reject it.

This fixes some out of bounds reads. It's not clear what degree of control
over subsequent execution could be gained by someone who can carefully
set up the contents of memory before loading an invalid JPEG file.

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