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

Some especially silly Coverity-induced paranoia.

parent 62c8638b
No related branches found
No related tags found
1 merge request!488Overhaul LZH code
Pipeline #7530 passed
......@@ -834,7 +834,7 @@ do_xp_play_sample(unsigned char *sampo, size_t sz, int *freed)
int need_copy = 0;
#endif
#ifdef AFMT_U8
int wr;
size_t wr;
int i;
#endif
......@@ -976,12 +976,15 @@ do_xp_play_sample(unsigned char *sampo, size_t sz, int *freed)
#endif
#ifdef AFMT_U8
if(handle_type==SOUND_DEVICE_OSS) {
wr=0;
while(wr<sz) {
i=write(dsp, samp+wr, sz-wr);
if(i>=0)
wr+=i;
if (handle_type == SOUND_DEVICE_OSS) {
wr = 0;
while (wr < sz) {
i = write(dsp, samp + wr, sz - wr);
if (i >= 0) {
if ((SIZE_MAX - i) < wr)
wr = SIZE_MAX;
wr += i;
}
}
return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment