From e03288e8d660e18cd55f5707447843212811c78f Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Mon, 13 Oct 2014 20:11:10 -0400 Subject: * src/emms-print-metadata.c: Fix crash. Short (4 lines) contrib from Arnaud Fontaine . See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=715864 also: https://vcs-git-viewer.duckcorp.org/?p=people/arnau/emms.git;a=commit;h=27825228ba9d62902b75c45b1ffee3893b22cea8 --- src/emms-print-metadata.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/emms-print-metadata.c b/src/emms-print-metadata.c index d04e759..d22fe96 100644 --- a/src/emms-print-metadata.c +++ b/src/emms-print-metadata.c @@ -29,6 +29,7 @@ main (int argc, char **argv) { TagLib_File *file; TagLib_Tag *tag; + const TagLib_AudioProperties *properties; if (argc != 2) { @@ -62,7 +63,10 @@ main (int argc, char **argv) printf ("info-year=%d\n", taglib_tag_year (tag)); printf ("info-genre=%s\n", taglib_tag_genre (tag)); printf ("info-note=%s\n", taglib_tag_comment (tag)); - printf ("info-playing-time=%d\n", taglib_audioproperties_length (taglib_file_audioproperties (file))); + + properties = taglib_file_audioproperties (file); + printf ("info-playing-time=%d\n", + properties ? taglib_audioproperties_length (properties) : 0); taglib_tag_free_strings (); taglib_file_free (file); -- cgit v1.2.3