Fix crash when loading 24-bit brushes

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2020 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2012-09-29 16:01:53 +00:00
parent eb882524cd
commit 919357ab46
2 changed files with 7 additions and 9 deletions

View File

@ -3276,17 +3276,15 @@ void Load_picture(byte image)
Compute_limits();
Compute_paintbrush_coordinates();
}
}
Compute_optimal_menu_colors(Main_palette);
Redraw_layered_image();
End_of_modification();
Check_menu_mode();
Display_all_screen();
if (image)
Main_image_is_modified=0;
}
}
Destroy_context(&context);

View File

@ -685,7 +685,7 @@ void Load_image(T_IO_Context *context)
Cursor_shape=CURSOR_SHAPE_HOURGLASS;
Display_cursor();
Flush_update();
if (Convert_24b_bitmap_to_256(Brush,context->Buffer_image_24b,context->Width,context->Height,context->Palette))
if (Convert_24b_bitmap_to_256(context->Buffer_image,context->Buffer_image_24b,context->Width,context->Height,context->Palette))
File_error=2;
Hide_cursor();
Cursor_shape=CURSOR_SHAPE_ARROW;