File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- // Almsot all decoding code is from Xenia Canary, so leave the copyright here
1+ // Almost all decoding code is from Xenia Canary, so leave the copyright here
2+
23/* *
34******************************************************************************
45* Xenia : Xbox 360 Emulator Research Project *
@@ -353,12 +354,14 @@ void Decode(XmaPlayback *playback) {
353354 // Select the appropriate array based on the current channel.
354355 auto in = reinterpret_cast <const float *>(samples[j]);
355356
356- // Raw samples sometimes aren't within [-1, 1]
357- float scaled_sample = clamp_float (in[i], -1 .0f , 1 .0f ) * scale;
357+ if (in != nullptr ) {
358+ // Raw samples sometimes aren't within [-1, 1]
359+ float scaled_sample = clamp_float (in[i], -1 .0f , 1 .0f ) * scale;
358360
359- // Convert the sample and output it in big endian.
360- auto sample = static_cast <int16_t >(scaled_sample);
361- out[o++] = ByteSwap (sample);
361+ // Convert the sample and output it in big endian.
362+ auto sample = static_cast <int16_t >(scaled_sample);
363+ out[o++] = ByteSwap (sample);
364+ }
362365 }
363366 }
364367 }
You can’t perform that action at this time.
0 commit comments