Fixing potential crash when reading audio samples.