shithub: libtags

Download patch

ref: 5e8b0c6890f818951b947a9986f69364bc629b0c
parent: 0f87ccfbf40620cb0e2224a5a9e15c239ba4009a
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Mon Mar 4 13:00:15 EST 2024

id3v2: make sure genre index is >= 0

--- a/id3v2.c
+++ b/id3v2.c
@@ -35,7 +35,7 @@
 		for(; v[0]; v++){
 			if(v[0] == '(' && v[1] <= '9' && v[1] >= '0'){
 				int i = atoi(&v[1]);
-				if(i < Numgenre)
+				if(i >= 0 && i < Numgenre)
 					txtcb(ctx, Tgenre, k-1, id3genres[i]);
 				for(v++; v[0] && v[0] != ')'; v++);
 				v--;