shithub: libtags

Download patch

ref: cb906b7f354c006a9f26d08bcf9de36678c5a47b
parent: dcf689afcb99215a9b9f6b67cd0aa82e6b860541
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Mon Nov 2 08:48:33 EST 2020

make sure beuint/leuint work correctly with  d  of any type

--- a/tagspriv.h
+++ b/tagspriv.h
@@ -20,8 +20,8 @@
 	Numgenre = 192,
 };
 
-#define beuint(d) (uint)((d)[0]<<24 | (d)[1]<<16 | (d)[2]<<8 | (d)[3]<<0)
-#define leuint(d) (uint)((d)[3]<<24 | (d)[2]<<16 | (d)[1]<<8 | (d)[0]<<0)
+#define beuint(d) (uint)(((uchar*)(d))[0]<<24 | ((uchar*)(d))[1]<<16 | ((uchar*)(d))[2]<<8 | ((uchar*)(d))[3]<<0)
+#define leuint(d) (uint)(((uchar*)(d))[3]<<24 | ((uchar*)(d))[2]<<16 | ((uchar*)(d))[1]<<8 | ((uchar*)(d))[0]<<0)
 
 extern const char *id3genres[Numgenre];