diff --git a/src/hardware/hw_segs.c b/src/hardware/hw_segs.c
index 864675e1df0bd97d8782ceb02f6af062aa504acf..f184eee9a56ec10187bdba2dd3ae508bbfb06ee4 100644
--- a/src/hardware/hw_segs.c
+++ b/src/hardware/hw_segs.c
@@ -493,7 +493,7 @@ static void HWR_ProcessTwoSidedSegMiddle(FOutVector *wallVerts, gl_seg_bounds *b
 	fixed_t polytop, polytopslope, polybottom, polybottomslope;
 	fixed_t lowcut, highcut, lowcutslope, highcutslope;
 	fixed_t texturevpeg = 0, texheight = 0, midtexheight = 0;
-	INT32 repeats;
+	INT32 repeats = 0;
 
 	Surf.PolyColor.s.alpha = 255;