diff --git a/src/p_saveg.c b/src/p_saveg.c
index 2e4ba9228cbd35c0a89e238e26f811ba5453163c..09df38eb07416af7e5f3cbda308d05d332acdb54 100644
--- a/src/p_saveg.c
+++ b/src/p_saveg.c
@@ -3408,7 +3408,7 @@ static void P_NetUnArchiveThinkers(void)
 	{
 		for (;;)
 		{
-			thinker_t* th;
+			thinker_t* th = NULL;
 			tclass = READUINT8(save_p);
 
 			if (tclass == tc_end)
diff --git a/src/p_user.c b/src/p_user.c
index 6761d567d1fd6e810472e4aa111330c0210cebf1..b758cebe49a5e033184d58cbb9439f929cedb2ef 100644
--- a/src/p_user.c
+++ b/src/p_user.c
@@ -2049,7 +2049,7 @@ boolean P_PlayerHitFloor(player_t *player)
 					fixed_t mu = FixedMul(player->maxdash, player->mo->scale);
 					fixed_t mu2 = FixedHypot(player->mo->momx, player->mo->momy);
 					fixed_t ev;
-					mobj_t *missile;
+					mobj_t *missile = NULL;
 					if (mu2 < mu)
 						mu2 = mu;
 					ev = (50*FRACUNIT - (mu/25))/50;
diff --git a/src/r_things.c b/src/r_things.c
index 4b1586455e6f2eea2c3de86ca6d43ffe86e0313b..c791571ac28be2ad61b93f241123d835d6676982 100644
--- a/src/r_things.c
+++ b/src/r_things.c
@@ -2446,9 +2446,11 @@ static void R_DrawMaskedList (drawnode_t* head)
 
 void R_DrawMasked(maskcount_t* masks, UINT8 nummasks)
 {
-	drawnode_t heads[nummasks];	/**< Drawnode lists; as many as number of views/portals. */
+	drawnode_t *heads;	/**< Drawnode lists; as many as number of views/portals. */
 	SINT8 i;
 
+	heads = calloc(nummasks, sizeof(drawnode_t));
+
 	for (i = 0; i < nummasks; i++)
 	{
 		heads[i].next = heads[i].prev = &heads[i];
@@ -2474,6 +2476,8 @@ void R_DrawMasked(maskcount_t* masks, UINT8 nummasks)
 		R_DrawMaskedList(&heads[nummasks - 1]);
 		R_ClearDrawNodes(&heads[nummasks - 1]);
 	}
+
+	free(heads);
 }
 
 // ==========================================================================
diff --git a/src/s_sound.c b/src/s_sound.c
index 2db8392d7484e3ef24838b0713bb81c1a63e5eef..66b5d4f72a23fe7b80d4ca24f51dfc219f0b6155 100644
--- a/src/s_sound.c
+++ b/src/s_sound.c
@@ -1988,8 +1988,10 @@ void GameMIDIMusic_OnChange(void)
 	}
 }
 
+#ifdef HAVE_OPENMPT
 void ModFilter_OnChange(void)
 {
 	if (openmpt_mhandle)
 		openmpt_module_set_render_param(openmpt_mhandle, OPENMPT_MODULE_RENDER_INTERPOLATIONFILTER_LENGTH, cv_modfilter.value);
-}
\ No newline at end of file
+}
+#endif
\ No newline at end of file
diff --git a/src/sdl/Srb2SDL-vc10.vcxproj b/src/sdl/Srb2SDL-vc10.vcxproj
index d05a0d32414e38ea9906ad8cef3cf0b24960e2f8..72c38b3dc090061f370d6822d7050912ed2f34ca 100644
--- a/src/sdl/Srb2SDL-vc10.vcxproj
+++ b/src/sdl/Srb2SDL-vc10.vcxproj
@@ -277,6 +277,7 @@
     <ClInclude Include="..\r_local.h" />
     <ClInclude Include="..\r_main.h" />
     <ClInclude Include="..\r_plane.h" />
+    <ClInclude Include="..\r_portal.h" />
     <ClInclude Include="..\r_segs.h" />
     <ClInclude Include="..\r_sky.h" />
     <ClInclude Include="..\r_splats.h" />
@@ -430,6 +431,7 @@
     </ClCompile>
     <ClCompile Include="..\r_main.c" />
     <ClCompile Include="..\r_plane.c" />
+    <ClCompile Include="..\r_portal.c" />
     <ClCompile Include="..\r_segs.c" />
     <ClCompile Include="..\r_sky.c" />
     <ClCompile Include="..\r_splats.c" />
diff --git a/src/sdl/Srb2SDL-vc10.vcxproj.filters b/src/sdl/Srb2SDL-vc10.vcxproj.filters
index ca6bd38d211e4c4be9cbd853d5630e6492203694..9e442000fdc1a5ad0a2e6643cd06eb99ddd8cf11 100644
--- a/src/sdl/Srb2SDL-vc10.vcxproj.filters
+++ b/src/sdl/Srb2SDL-vc10.vcxproj.filters
@@ -453,6 +453,9 @@
     <ClInclude Include="..\hardware\hw_clip.h">
       <Filter>Hw_Hardware</Filter>
     </ClInclude>
+    <ClInclude Include="..\r_portal.h">
+      <Filter>R_Rend</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <CustomBuild Include="..\tmap.nas">
@@ -894,6 +897,10 @@
     <ClCompile Include="..\hardware\hw_clip.c">
       <Filter>Hw_Hardware</Filter>
     </ClCompile>
+    <ClCompile Include="..\apng.c" />
+    <ClCompile Include="..\r_portal.c">
+      <Filter>R_Rend</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <Image Include="Srb2SDL.ico">
diff --git a/src/win32/Srb2win-vc10.vcxproj b/src/win32/Srb2win-vc10.vcxproj
index acab2507a37d995112b6402e7c83ac0d6f0dd57a..c0fe8eda9ad5f2d73f7a0c2cd7f1a2023a02dd0e 100644
--- a/src/win32/Srb2win-vc10.vcxproj
+++ b/src/win32/Srb2win-vc10.vcxproj
@@ -293,6 +293,7 @@
     </ClCompile>
     <ClCompile Include="..\r_main.c" />
     <ClCompile Include="..\r_plane.c" />
+    <ClCompile Include="..\r_portal.c" />
     <ClCompile Include="..\r_segs.c" />
     <ClCompile Include="..\r_sky.c" />
     <ClCompile Include="..\r_splats.c" />
@@ -443,6 +444,7 @@
     <ClInclude Include="..\r_local.h" />
     <ClInclude Include="..\r_main.h" />
     <ClInclude Include="..\r_plane.h" />
+    <ClInclude Include="..\r_portal.h" />
     <ClInclude Include="..\r_segs.h" />
     <ClInclude Include="..\r_sky.h" />
     <ClInclude Include="..\r_splats.h" />
diff --git a/src/win32/Srb2win-vc10.vcxproj.filters b/src/win32/Srb2win-vc10.vcxproj.filters
index c21cedb8a4bf258af6efa2d9a2faba1de00da325..93806e3951066fff4172cdc9f60a0315171e74f4 100644
--- a/src/win32/Srb2win-vc10.vcxproj.filters
+++ b/src/win32/Srb2win-vc10.vcxproj.filters
@@ -456,6 +456,10 @@
     <ClCompile Include="..\hardware\hw_clip.c">
       <Filter>Hw_Hardware</Filter>
     </ClCompile>
+    <ClCompile Include="..\apng.c" />
+    <ClCompile Include="..\r_portal.c">
+      <Filter>R_Rend</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="afxres.h">
@@ -857,6 +861,10 @@
     <ClInclude Include="..\hardware\hw_clip.h">
       <Filter>Hw_Hardware</Filter>
     </ClInclude>
+    <ClInclude Include="..\apng.h" />
+    <ClInclude Include="..\r_portal.h">
+      <Filter>R_Rend</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <Image Include="Srb2win.ico">