diff options
author | Ryan Jackson <rdjackso@rockbox.org> | 2005-07-15 06:44:41 +0000 |
---|---|---|
committer | Ryan Jackson <rdjackso@rockbox.org> | 2005-07-15 06:44:41 +0000 |
commit | 006f7045be0982f9109f78eb07b35fc2b5544a4a (patch) | |
tree | 6a77d6997f34beb977fb344f9d8531d37a1fcf9f /tools | |
parent | f580941b5ac4003684fad597c5bea0d875888ecf (diff) |
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
Diffstat (limited to 'tools')
-rw-r--r-- | tools/vorbiscomm.pm | 16 |
1 files changed, 11 insertions, 5 deletions
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 |