Hi Alexander, et al,
Below is a patch to make Lame 3.95.1 compile and run on AIX, HP-UX,
IRIX, Solaris, UnixWare, SCO Open Server and SunOS 4.1.x.
The change involves the call to snprintf() in libmp3lame/id3tag.c.,
but snprintf() is not available on many of these platforms. I know
that in general replacing snprintf() with sprintf() removes a layer
of string buffer overflow protection, but in this case it should
be safe because the size of string is bounded.
Hope you will consider putting this into your source (or, if you
prefer, you can simply take the __sun__ case and make that the
code to serve all platforms).
------------X cut X-------------
diff -r -c lame-3.95.1/libmp3lame/id3tag.c lame-3.95.1.ti/libmp3lame/id3tag.c
*** lame-3.95.1/libmp3lame/id3tag.c Sun Jun 1 11:14:06 2003
--- lame-3.95.1-new/libmp3lame/id3tag.c Fri Jan 16 22:57:57 2004
***************
*** 402,409 ****
--- 402,419 ----
unsigned int index;
/* calulate size of tag starting with 10-byte tag header */
tag_size = 10;
+ #if defined(__hpux) || defined(__svr4__) || defined(M_UNIX) || defined(_AIX)
+ encoder_length = sprintf(encoder,
+ "LAME v%s", get_lame_short_version());
+ #else
+ #if defined(__sun__)
+ (void) sprintf(encoder, "LAME v%s", get_lame_short_version());
+ encoder_length = strlen(encoder);
+ #else
encoder_length = snprintf(encoder, sizeof(encoder),
"LAME v%s", get_lame_short_version());
+ #endif
+ #endif
tag_size += 11 + encoder_length;
if (title_length) {
/* add 10-byte frame header, 1 encoding descriptor byte ... */
------------X cut X-------------
-Ti
--
R 1 3 5 Ti Kan
|_|_|_| http://www.amb.org/ti
| | | Vorsprung durch Technik
2 4 6
_______________________________________________
mp3encoder mailing list
[EMAIL PROTECTED]
http://minnie.tuhs.org/mailman/listinfo/mp3encoder