--- grip-3.3.0/src/discdb.c.orig	2005-03-09 00:02:00.230558368 -0500
+++ grip-3.3.0/src/discdb.c	2005-03-09 00:24:28.317617984 -0500
@@ -319,7 +319,7 @@
     query->query_match=MATCH_EXACT;
     query->query_matches=0;
 
-    while((inbuffer=DiscDBReadLine(&dataptr))) {
+    while(query->query_matches < MAX_INEXACT_MATCHES && (inbuffer=DiscDBReadLine(&dataptr))) {
       query->query_list[query->query_matches].list_genre=
 	DiscDBGenreValue(g_strstrip(strtok(inbuffer," ")));
       
@@ -339,7 +339,7 @@
     query->query_match=MATCH_INEXACT;
     query->query_matches=0;
 
-    while((inbuffer=DiscDBReadLine(&dataptr))) {
+    while(query->query_matches < MAX_INEXACT_MATCHES && (inbuffer=DiscDBReadLine(&dataptr))) {
       query->query_list[query->query_matches].list_genre=
 	DiscDBGenreValue(g_strstrip(strtok(inbuffer," ")));