|
|
|
@ -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) |
|
|
|
|