shithub: aacdec

Download patch

ref: 5866a7cbffd838b0bc79b267969b373de0b6c8b4
parent: 95192f051ae87f4cee8ccc285893690446acd79c
author: menno <menno>
date: Sun Aug 3 08:17:20 EDT 2003

fixed GENRE tag problem

--- a/common/mp4v2/mp4meta.cpp
+++ b/common/mp4v2/mp4meta.cpp
@@ -576,11 +576,13 @@
 {
     if (genre > 0 && genre <= sizeof(ID3v1GenreList)/sizeof(*ID3v1GenreList))
     {
-        *GenreStr = (char*)malloc(strlen((ID3v1GenreList[genre-1])+1)*sizeof(char));
+        *GenreStr = (char*)malloc((strlen(ID3v1GenreList[genre-1])+1)*sizeof(char));
+        memset(*GenreStr, 0, (strlen(ID3v1GenreList[genre-1])+1)*sizeof(char));
         strcpy(*GenreStr, ID3v1GenreList[genre-1]);
         return 0;
     } else {
-        *GenreStr[0] = '\0';
+        *GenreStr = (char*)malloc(2*sizeof(char));
+        memset(*GenreStr, 0, 2*sizeof(char));
         return 1;
     }
 }