Page 1 of 1

[Fixed] Fix wrong logic of snapshot inconsistent with movie

Posted: Tue Jan 04, 2011 2:38 pm
by gocha
One of fatal glitches since 1.51.

Code: Select all

diff --git a/movie.cpp b/movie.cpp
index de5dc48..9286b8f 100644
--- a/movie.cpp
+++ b/movie.cpp
@@ -745,7 +745,8 @@ int S9xMovieUnfreeze (uint8 *buf, uint32 size)
 	}
 	else
 	{
-		if (current_frame > Movie.MaxFrame || current_sample > Movie.MaxSample || memcmp(Movie.InputBuffer, ptr, space_needed))
+		uint32	space_processed = (Movie.BytesPerSample * (current_sample + 1));
+		if (current_frame > Movie.MaxFrame || current_sample > Movie.MaxSample || memcmp(Movie.InputBuffer, ptr, space_processed))
 			return (SNAPSHOT_INCONSISTENT);
 
 		change_state(MOVIE_STATE_PLAY);

Posted: Fri Jan 07, 2011 1:16 pm
by BearOso
Committed.

Also, if you post any more patches, could you just upload them somewhere like pastebin instead of putting it directly in the post? The Snes9x forums badly mangle the whitespace.

Posted: Sat Jan 08, 2011 2:28 pm
by gocha
BearOso wrote:Committed.

Also, if you post any more patches, could you just upload them somewhere like pastebin instead of putting it directly in the post? The Snes9x forums badly mangle the whitespace.
Thank you very much, I'll do so next time.