Skip to content

Commit de892f9

Browse files
committed
Fix crash when loading state outside of replays
1 parent 7a603e4 commit de892f9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

input/bsv/bsvmovie.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,6 @@ bool replay_set_serialized_data(void* buf)
942942
bsv_movie_t *handle = input_st->bsv_movie_state_handle;
943943
bool playback = (input_st->bsv_movie_state.flags & BSV_FLAG_MOVIE_PLAYBACK) ? true : false;
944944
bool recording = (input_st->bsv_movie_state.flags & BSV_FLAG_MOVIE_RECORDING) ? true : false;
945-
handle->cur_save_valid = false;
946945
/* If there is no current replay, ignore this entirely.
947946
TODO/FIXME: Later, consider loading up the replay
948947
and allow the user to continue it?
@@ -951,6 +950,9 @@ bool replay_set_serialized_data(void* buf)
951950
if (!(playback || recording))
952951
return true;
953952

953+
if (!handle)
954+
return false;
955+
handle->cur_save_valid = false;
954956
if (!buffer)
955957
{
956958
if (recording)

0 commit comments

Comments
 (0)