From 006f7045be0982f9109f78eb07b35fc2b5544a4a Mon Sep 17 00:00:00 2001 From: Ryan Jackson Date: Fri, 15 Jul 2005 06:44:41 +0000 Subject: songdb.pl doesn't crash when trying to parse Ogg FLAC or Ogg Speex files now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7150 a1c6a512-1295-4272-9138-f99709370657 --- tools/vorbiscomm.pm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/vorbiscomm.pm b/tools/vorbiscomm.pm index e2bae11276..f2e48e8632 100644 --- a/tools/vorbiscomm.pm +++ b/tools/vorbiscomm.pm @@ -64,10 +64,11 @@ sub load $data{'filename'} = $file; $data{'fileHandle'} = \*FILE; - _init(\%data); - _loadInfo(\%data); - _loadComments(\%data); - _calculateTrackLength(\%data); + if (_init(\%data)) { + _loadInfo(\%data); + _loadComments(\%data); + _calculateTrackLength(\%data); + } close FILE; @@ -92,8 +93,12 @@ sub info sub comment_tags { my $self = shift; + + if ( $self && $self->{'COMMENT_KEYS'} ) { + return @{$self->{'COMMENT_KEYS'}}; + } - return @{$self->{'COMMENT_KEYS'}}; + return undef; } sub comment @@ -160,6 +165,7 @@ sub _init } $data->{'startInfoHeader'} = $byteCount; + return 1; # Success } sub _checkHeader -- cgit v1.2.3