aboutsummaryrefslogtreecommitdiff
path: root/libmpio
diff options
context:
space:
mode:
Diffstat (limited to 'libmpio')
-rw-r--r--libmpio/defs.h4
-rw-r--r--libmpio/src/directory.c10
2 files changed, 11 insertions, 3 deletions
diff --git a/libmpio/defs.h b/libmpio/defs.h
index dd3cd09..413ab6a 100644
--- a/libmpio/defs.h
+++ b/libmpio/defs.h
@@ -1,5 +1,5 @@
/*
- * $Id: defs.h,v 1.27 2003/06/26 19:53:58 germeier Exp $
+ * $Id: defs.h,v 1.28 2003/07/15 07:34:53 germeier Exp $
*
* libmpio - a library for accessing Digit@lways MPIO players
* Copyright (C) 2002, 2003 Markus Germeier
@@ -72,6 +72,8 @@ typedef enum { FTYPE_CHAN = 0x00,
FTYPE_WAV = 'V',
FTYPE_ENTRY = 'R',
FTYPE_DIR = 'D',
+ FTYPE_BROKEN = 'X', /* internal "dummy" type, used when
+ internal FAT is broken */
FTYPE_PLAIN = '-'} mpio_filetype_t;
/* fixed filenames */
diff --git a/libmpio/src/directory.c b/libmpio/src/directory.c
index bb19518..7240c14 100644
--- a/libmpio/src/directory.c
+++ b/libmpio/src/directory.c
@@ -1,5 +1,5 @@
/*
- * $Id: directory.c,v 1.9 2003/07/14 21:29:09 germeier Exp $
+ * $Id: directory.c,v 1.10 2003/07/15 07:34:53 germeier Exp $
*
* libmpio - a library for accessing Digit@lways MPIO players
* Copyright (C) 2002, 2003 Markus Germeier
@@ -804,7 +804,13 @@ mpio_dentry_get_real(mpio_t *m, mpio_mem_t mem, BYTE *buffer,
*type = FTYPE_PLAIN;
if (mem == MPIO_INTERNAL_MEM) {
f = mpio_dentry_get_startcluster(m, mem, buffer);
- *type = m->internal.fat[f->entry * 0x10 + 0x06];
+ if (f) {
+ *type = m->internal.fat[f->entry * 0x10 + 0x06];
+ } else {
+ /* we did not find the startcluster, thus the internal
+ FAT is broken for this file */
+ *type = FTYPE_BROKEN;
+ }
}
}