Merge branch 'master' of https://github.com/MarcoLizza/stb into working

This commit is contained in:
Sean Barrett 2020-02-05 03:16:46 -08:00
commit efdaadcb4a
2 changed files with 13 additions and 13 deletions

View File

@ -1053,13 +1053,13 @@ static size_t stbds_siphash_bytes(void *p, size_t len, size_t seed)
}
data = len << (STBDS_SIZE_T_BITS-8);
switch (len - i) {
case 7: data |= ((size_t) d[6] << 24) << 24;
case 6: data |= ((size_t) d[5] << 20) << 20;
case 5: data |= ((size_t) d[4] << 16) << 16;
case 4: data |= (d[3] << 24);
case 3: data |= (d[2] << 16);
case 2: data |= (d[1] << 8);
case 1: data |= d[0];
case 7: data |= ((size_t) d[6] << 24) << 24; // fall through
case 6: data |= ((size_t) d[5] << 20) << 20; // fall through
case 5: data |= ((size_t) d[4] << 16) << 16; // fall through
case 4: data |= (d[3] << 24); // fall through
case 3: data |= (d[2] << 16); // fall through
case 2: data |= (d[1] << 8); // fall through
case 1: data |= d[0]; // fall through
case 0: break;
}
v3 ^= data;

View File

@ -908,7 +908,7 @@ static int error(vorb *f, enum STBVorbisError e)
#define array_size_required(count,size) (count*(sizeof(void *)+(size)))
#define temp_alloc(f,size) (f->alloc.alloc_buffer ? setup_temp_malloc(f,size) : alloca(size))
#define temp_free(f,p) 0
#define temp_free(f,p) (void)0
#define temp_alloc_save(f) ((f)->temp_offset)
#define temp_alloc_restore(f,p) ((f)->temp_offset = (p))
@ -3632,7 +3632,7 @@ static int start_decoder(vorb *f)
for(i=0; i < len; ++i) {
f->vendor[i] = get8_packet(f);
}
f->vendor[len] = (char)NULL;
f->vendor[len] = (char)'\0';
//user comments
f->comment_list_length = get32_packet(f);
f->comment_list = (char**)setup_malloc(f, sizeof(char*) * (f->comment_list_length));
@ -3644,7 +3644,7 @@ static int start_decoder(vorb *f)
for(j=0; j < len; ++j) {
f->comment_list[i][j] = get8_packet(f);
}
f->comment_list[i][len] = (char)NULL;
f->comment_list[i][len] = (char)'\0';
}
// framing_flag
@ -3969,7 +3969,7 @@ static int start_decoder(vorb *f)
g->sorted_order[j] = (uint8) p[j].id;
// precompute the neighbors
for (j=2; j < g->values; ++j) {
int low,hi;
int low = 0,hi = 0;
neighbors(g->Xlist, j, &low,&hi);
g->neighbors[j][0] = low;
g->neighbors[j][1] = hi;
@ -4673,7 +4673,7 @@ static int seek_to_sample_coarse(stb_vorbis *f, uint32 sample_number)
ProbedPage left, right, mid;
int i, start_seg_with_known_loc, end_pos, page_start;
uint32 delta, stream_length, padding, last_sample_limit;
double offset, bytes_per_sample;
double offset = 0.0, bytes_per_sample = 0.0;
int probe = 0;
// find the last page and validate the target sample
@ -5225,7 +5225,7 @@ static void convert_samples_short(int buf_c, short **buffer, int b_offset, int d
int stb_vorbis_get_frame_short(stb_vorbis *f, int num_c, short **buffer, int num_samples)
{
float **output;
float **output = NULL;
int len = stb_vorbis_get_frame_float(f, NULL, &output);
if (len > num_samples) len = num_samples;
if (len)