diff --git a/ikcp.c b/ikcp.c
index ef11690..7ae9921 100644
--- a/ikcp.c
+++ b/ikcp.c
@@ -749,7 +749,7 @@ int ikcp_input(ikcpcb *kcp, const char *data, long size)
 		ikcp_log(kcp, IKCP_LOG_INPUT, "[RI] %d bytes", size);
 	}
 
-	if (data == NULL || size < 24) return -1;
+	if (data == NULL || size < IKCP_OVERHEAD) return -1;
 
 	while (1) {
 		IUINT32 ts, sn, len, una, conv;