summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b7c6f2a)
raw | patch | inline | side by side (parent: b7c6f2a)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 11 Apr 2021 10:08:28 +0000 (13:08 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 11 Apr 2021 10:08:28 +0000 (13:08 +0300) |
src/openal/sound.c | patch | blob | history |
diff --git a/src/openal/sound.c b/src/openal/sound.c
index 7bb60a0933b0145b63a7d4a70054e06f4db5af75..c1411f0f1d47f64b50ea71358a59d838fff866f3 100644 (file)
--- a/src/openal/sound.c
+++ b/src/openal/sound.c
#pragma pack(1)
typedef struct dmi {
- dword len;
- dword rate;
- dword lstart;
- dword llen;
+ word len;
+ word rate;
+ word lstart;
+ word llen;
byte data[];
} dmi;
#pragma pack()
handle = M_lock(id);
if (handle != NULL) {
void *data = handle;
- dword len = F_getreslen(id);
- dword rate = 11025;
- dword lstart = 0;
- dword llen = 0;
+ word len = F_getreslen(id);
+ word rate = 11025;
+ word lstart = 0;
+ word llen = 0;
int sign = 0;
- if (len > 16) {
+ if (len > 8) {
dmi *hdr = handle;
- dword hdr_len = int2host(hdr->len);
- dword hdr_rate = int2host(hdr->rate);
- dword hdr_lstart = int2host(hdr->lstart);
- dword hdr_llen = int2host(hdr->llen);
- if (hdr_len <= len - 8 && hdr_lstart + hdr_llen <= len - 16) {
+ word hdr_len = short2host(hdr->len);
+ word hdr_rate = short2host(hdr->rate);
+ word hdr_lstart = short2host(hdr->lstart);
+ word hdr_llen = short2host(hdr->llen);
+ if (hdr_len <= len - 4 && hdr_lstart + hdr_llen <= len - 8) {
data = hdr->data;
len = hdr_len;
rate = hdr_rate;