--- a/tagutils/tagutils-wav.c
+++ b/tagutils/tagutils-wav.c
@@ -204,7 +204,7 @@
 				p += taglen + 8;
 				off += taglen + 8;
 				/* Handle some common WAV file malformations */
-				while (*p == '\0') {
+				while (*p == '\0' && off < len) {
 					p++;
 					off++;
 				}