Skip to content
Snippets Groups Projects
Commit 63cec349 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Remove need_copy variable when it won't be used.

Fixes Coverity issue.
parent 6e11c699
No related branches found
No related tags found
No related merge requests found
Pipeline #5916 passed
...@@ -832,7 +832,9 @@ static bool ...@@ -832,7 +832,9 @@ static bool
do_xp_play_sample(unsigned char *sampo, size_t sz, int *freed) do_xp_play_sample(unsigned char *sampo, size_t sz, int *freed)
{ {
unsigned char *samp; unsigned char *samp;
#if defined(WITH_PORTAUDIO) || defined(_WIN32) || defined(WITH_SDL_AUDIO)
int need_copy = 0; int need_copy = 0;
#endif
#ifdef AFMT_U8 #ifdef AFMT_U8
int wr; int wr;
int i; int i;
...@@ -853,6 +855,7 @@ do_xp_play_sample(unsigned char *sampo, size_t sz, int *freed) ...@@ -853,6 +855,7 @@ do_xp_play_sample(unsigned char *sampo, size_t sz, int *freed)
need_copy = 1; need_copy = 1;
#endif #endif
#if defined(WITH_PORTAUDIO) || defined(_WIN32) || defined(WITH_SDL_AUDIO)
if (freed) if (freed)
*freed = need_copy; *freed = need_copy;
if (need_copy) { if (need_copy) {
...@@ -869,6 +872,11 @@ do_xp_play_sample(unsigned char *sampo, size_t sz, int *freed) ...@@ -869,6 +872,11 @@ do_xp_play_sample(unsigned char *sampo, size_t sz, int *freed)
else { else {
samp = sampo; samp = sampo;
} }
#else
if (freed)
*freed = 0;
samp = sampo;
#endif
#ifdef WITH_PULSEAUDIO #ifdef WITH_PULSEAUDIO
if(handle_type==SOUND_DEVICE_PULSEAUDIO) { if(handle_type==SOUND_DEVICE_PULSEAUDIO) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment