summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-17 20:36:09 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-17 20:37:35 +0100
commitcf1376082676cbcf514fc15d9fc7a418a03f2133 (patch)
tree1839c3920139a029be6ecc89fc4079904cfb4eaf
parentb0bce1c0e0042b7952341871598fcffd21ad4bf4 (diff)
fixed crashbug in sid plugin
-rw-r--r--csid.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/csid.cpp b/csid.cpp
index 7e8dbd90..76e6b43e 100644
--- a/csid.cpp
+++ b/csid.cpp
@@ -324,6 +324,13 @@ sldb_find (const uint8_t *digest) {
extern "C" int
csid_init (DB_playItem_t *it) {
+ // libsidplay crashes if file doesn't exist
+ // so i have to check it here
+ FILE *fp = fopen (it->fname, "rb");
+ if (!fp ){
+ return -1;
+ }
+ fclose (fp);
sidplay = new sidplay2;
resid = new ReSIDBuilder ("wtf");
resid->create (sidplay->info ().maxsids);