Skip to content
Snippets Groups Projects
Commit 610c5986 authored by Daniel Axtens's avatar Daniel Axtens Committed by Julian Andres Klode
Browse files

video/readers/jpeg: Do not reallocate a given huff table


Fix a memory leak where an invalid file could cause us to reallocate
memory for a huffman table we had already allocated memory for.

Signed-off-by: default avatarDaniel Axtens <dja@axtens.net>
Reviewed-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>
parent 40be99c5
No related branches found
No related tags found
No related merge requests found
......@@ -245,6 +245,9 @@ grub_jpeg_decode_huff_table (struct grub_jpeg_data *data)
n += count[i];
id += ac * 2;
if (data->huff_value[id] != NULL)
return grub_error (GRUB_ERR_BAD_FILE_TYPE,
"jpeg: attempt to reallocate huffman table");
data->huff_value[id] = grub_malloc (n);
if (grub_errno)
return grub_errno;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment