mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
* grub-core/video/readers/jpeg.c: Avoid division by zero.
This commit is contained in:
1 parent
750f4bacd3
commit
4816dcac19
2 files changed
+5
-1
No files matched your search
@@ -317,7 +317,7 @@ grub_jpeg_decode_sof (struct grub_jpeg_data *data)
|
||||
{
|
||||
data->vs = ss & 0xF; /* Vertical sampling. */
|
||||
data->hs = ss >> 4; /* Horizontal sampling. */
|
||||
if ((data->vs > 2) || (data->hs > 2))
|
||||
if ((data->vs > 2) || (data->hs > 2) || (data->vs == 0) || (data->hs == 0))
|
||||
return grub_error (GRUB_ERR_BAD_FILE_TYPE,
|
||||
"jpeg: sampling method not supported");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user