Fix MNG recording (nw)

This commit is contained in:
Miodrag Milanovic 2014-04-05 15:50:22 +00:00
parent c3a166e962
commit 658240cccc

View File

@ -1228,8 +1228,9 @@ void video_manager::record_frame()
} }
// write the next frame // write the next frame
const rgb_t *palette = (machine().first_screen()->palette() != NULL) ? machine().first_screen()->palette()->palette()->entry_list_adjusted() : NULL; const rgb_t *palette = (machine().first_screen() !=NULL && machine().first_screen()->palette() != NULL) ? machine().first_screen()->palette()->palette()->entry_list_adjusted() : NULL;
png_error error = mng_capture_frame(*m_mngfile, &pnginfo, m_snap_bitmap, machine().first_screen()->palette()->entries(), palette); int entries = (machine().first_screen() !=NULL && machine().first_screen()->palette() != NULL) ? machine().first_screen()->palette()->entries() : 0;
png_error error = mng_capture_frame(*m_mngfile, &pnginfo, m_snap_bitmap, entries, palette);
png_free(&pnginfo); png_free(&pnginfo);
if (error != PNGERR_NONE) if (error != PNGERR_NONE)
{ {