diff query.cpp @ 598:b2a941a372fb

Test for audiodb_retrieve_datum() The good news: my fix for audiodb_track_id_datum()'s timesTable handling looks correct. The bad news: we need to NULL out fields we don't fill with data. Do so.
author mas01cr
date Wed, 12 Aug 2009 14:57:11 +0000
parents 6ad0a6e67d4c
children e21a3db643af
line wrap: on
line diff
--- a/query.cpp	Tue Aug 11 21:57:46 2009 +0000
+++ b/query.cpp	Wed Aug 12 14:57:11 2009 +0000
@@ -226,9 +226,13 @@
     malloc_and_fill_or_goto_error(double *, d->data, adb->header->dataOffset + track_offset, d->nvectors * d->dim * sizeof(double));
     if(adb->header->flags & ADB_HEADER_FLAG_POWER) {
       malloc_and_fill_or_goto_error(double *, d->power, adb->header->powerTableOffset + track_offset / d->dim, d->nvectors * sizeof(double));
+    } else {
+      d->power = NULL;
     }
     if(adb->header->flags & ADB_HEADER_FLAG_TIMES) {
       malloc_and_fill_or_goto_error(double *, d->times, adb->header->timesTableOffset + 2 * track_offset / d->dim, 2 * d->nvectors * sizeof(double));
+    } else {
+      d->times = NULL;
     }
     return 0;
   }