fixed taking screen shot (nw)

This commit is contained in:
Miodrag Milanovic 2014-02-27 16:57:45 +00:00
parent 93a0352d1c
commit fb2c93559b

View File

@ -310,8 +310,9 @@ void video_manager::save_snapshot(screen_device *screen, emu_file &file)
png_add_text(&pnginfo, "System", text2);
// now do the actual work
const rgb_t *palette = (screen->palette() != NULL) ? screen->palette()->palette()->entry_list_adjusted() : NULL;
png_error error = png_write_bitmap(file, &pnginfo, m_snap_bitmap, screen->palette()->entries(), palette);
const rgb_t *palette = (screen !=NULL && screen->palette() != NULL) ? screen->palette()->palette()->entry_list_adjusted() : NULL;
int entries = (screen !=NULL && screen->palette() != NULL) ? screen->palette()->entries() : 0;
png_error error = png_write_bitmap(file, &pnginfo, m_snap_bitmap, entries, palette);
if (error != PNGERR_NONE)
mame_printf_error("Error generating PNG for snapshot: png_error = %d\n", error);