Hi,
I fixed my installation with the following patch to id3.c (based on
Audio::Scan 0.93):
--- id3.c.ORIG 2012-03-11 21:53:17.123312553 +0100
+++ id3.c 2012-03-12 19:16:18.930193394 +0100
@@ -824,7 +824,7 @@
// v2.4 handles multiple genres using null char separators (or
$00 $00 in UTF-16),
// this is handled by _id3_get_utf8_string
read += _id3_get_utf8_string(id3, &value, size - read, encoding);
- if (value != NULL && SvPOK(value)) {
+ if (value != NULL && SvPOK(value) && SvPVX(value)!=0 ) {
sptr = SvPVX(value);
// Test if the string contains only a number,
@@ -834,7 +834,14 @@
if ( tmp == end ) {
// Convert raw number to genre string
- av_push( genres, newSVpv( _id3_genre_name((char *)sptr), 0 ) );
+
+ // Perl 5.10 (and later) behavior of newSVpv() returns NULL for
+ // a NULL input. Note that _id3_genre_name() returns NULL for
an empty string.
+ // Earlier perl versions crash if newSVpv() is fed a NULL
pointer. Thus, the test to
+ // not push a NULL on genres. /petersv 2012-03-12
+ if (*sptr) {
+ av_push( genres, newSVpv( _id3_genre_name((char *)sptr), 0 ) );
+ }
// value as an SV won't be used, must drop refcnt
SvREFCNT_dec(value);
This allowed the scan to compplete on my library. I think this is only a
problem for perl < 5.10. Since RHEL5 uses perl 5.8 I think it is still
common.