Fix setting the source format before using it.

Change-Id: I47b82f0e10e572943c31df521b1b74492ba6318e
Reviewed-on: https://swiftshader-review.googlesource.com/3081
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
diff --git a/src/Main/FrameBuffer.cpp b/src/Main/FrameBuffer.cpp
index d0216a8..17563ca 100644
--- a/src/Main/FrameBuffer.cpp
+++ b/src/Main/FrameBuffer.cpp
@@ -158,6 +158,8 @@
 			return;
 		}
 
+		sourceFormat = format;
+
 		if(topLeftOrigin)
 		{
 			target = source;
@@ -171,8 +173,6 @@
 			target = (byte*)source + (height - 1) * sStride;
 		}
 
-		sourceFormat = format;
-
 		cursorX = cursorPositionX - cursorHotspotX;
 		cursorY = cursorPositionY - cursorHotspotY;