* grub-core/commands/videotest.c (grub_cmd_videotest): Fix error

	handling when creating text_layer failed.
	* grub-core/video/video.c (grub_video_create_render_target):
	Set result to 0 on error.
	(grub_video_delete_render_target): Do not dereference NULL.
parent aeace7f7
2013-04-19 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/commands/videotest.c (grub_cmd_videotest): Fix error
handling when creating text_layer failed.
* grub-core/video/video.c (grub_video_create_render_target):
Set result to 0 on error.
(grub_video_delete_render_target): Do not dereference NULL.
2013-04-19 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/elfXX.c (grub_elfXX_load): Handle
......@@ -71,10 +71,10 @@ grub_cmd_videotest (grub_command_t cmd __attribute__ ((unused)),
grub_font_t fixed;
struct grub_font_glyph *glyph;
grub_video_create_render_target (&text_layer, width, height,
GRUB_VIDEO_MODE_TYPE_RGB
| GRUB_VIDEO_MODE_TYPE_ALPHA);
if (!text_layer)
if (grub_video_create_render_target (&text_layer, width, height,
GRUB_VIDEO_MODE_TYPE_RGB
| GRUB_VIDEO_MODE_TYPE_ALPHA)
|| !text_layer)
goto fail;
grub_video_set_active_render_target (text_layer);
......
......@@ -339,6 +339,7 @@ grub_video_create_render_target (struct grub_video_render_target **result,
unsigned int width, unsigned int height,
unsigned int mode_type)
{
*result = 0;
if (! grub_video_adapter_active)
return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");
......@@ -351,6 +352,8 @@ grub_video_create_render_target (struct grub_video_render_target **result,
grub_err_t
grub_video_delete_render_target (struct grub_video_render_target *target)
{
if (!target)
return GRUB_ERR_NONE;
if (! grub_video_adapter_active)
return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated");
......
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