diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c
index 05afff37fdf40ad7166cbf155ad762642e44f4ab..5f513089618c63fb4198afaf1d7ba3d1b214c7e5 100644
--- a/src/hardware/hw_md2.c
+++ b/src/hardware/hw_md2.c
@@ -1410,7 +1410,9 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
 			// If so, uvs need to be readjusted.
 			// Comparing floats with the != operator here should be okay because they
 			// are just copies of glpatches' max_s and max_t values.
-			if (gpatch->max_s != md2->model->max_s || gpatch->max_t != md2->model->max_t)
+			// Instead of the != operator, memcmp is used to avoid a compiler warning.
+			if (memcmp(&(gpatch->max_s), &(md2->model->max_s), sizeof(md2->model->max_s)) != 0 ||
+				memcmp(&(gpatch->max_t), &(md2->model->max_t), sizeof(md2->model->max_t)) != 0)
 				adjustTextureCoords(md2->model, gpatch);
 			HWR_GetMappedPatch(gpatch, spr->colormap);
 		}
diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c
index 195f3d6f7d2a42f9745cf187b4ae5ba24e1f9ef9..da86dc0fd3e813415169c3d26cc626d1c9cbde36 100644
--- a/src/hardware/r_opengl/r_opengl.c
+++ b/src/hardware/r_opengl/r_opengl.c
@@ -2772,7 +2772,9 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32
 	// (Can happen when model uses a sprite as a texture and the sprite changes)
 	// Comparing floats with the != operator here should be okay because they
 	// are just copies of glpatches' max_s and max_t values.
-	if (model->vbo_max_s != model->max_s || model->vbo_max_t != model->max_t)
+	// Instead of the != operator, memcmp is used to avoid a compiler warning.
+	if (memcmp(&(model->vbo_max_s), &(model->max_s), sizeof(model->max_s)) != 0 ||
+		memcmp(&(model->vbo_max_t), &(model->max_t), sizeof(model->max_t)) != 0)
 		useVBO = false;
 
 	pglEnableClientState(GL_NORMAL_ARRAY);