Commit 4816dcac authored by Vladimir Serbinenko's avatar Vladimir Serbinenko
Browse files

* grub-core/video/readers/jpeg.c: Avoid division by zero.

parent 750f4bac
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/video/readers/jpeg.c: Avoid sivision by zero.
2015-01-20 Vladimir Serbinenko <phcoder@gmail.com> 2015-01-20 Vladimir Serbinenko <phcoder@gmail.com>
   
* grub-core/disk/diskfilter.c: Validate volumes to avoid division * grub-core/disk/diskfilter.c: Validate volumes to avoid division
...@@ -317,7 +317,7 @@ grub_jpeg_decode_sof (struct grub_jpeg_data *data) ...@@ -317,7 +317,7 @@ grub_jpeg_decode_sof (struct grub_jpeg_data *data)
{ {
data->vs = ss & 0xF; /* Vertical sampling. */ data->vs = ss & 0xF; /* Vertical sampling. */
data->hs = ss >> 4; /* Horizontal 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, return grub_error (GRUB_ERR_BAD_FILE_TYPE,
"jpeg: sampling method not supported"); "jpeg: sampling method not supported");
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment