mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-01-19 07:50:49 +00:00
Fix multiplication result may overflow 'int' before it is converted to 'size_t'. (#911)
This commit is contained in:
parent
d709339ab5
commit
f81caf37f1
2 changed files with 3 additions and 3 deletions
|
@ -39,7 +39,7 @@
|
|||
* only be one producer thread and one consumer thread.
|
||||
*/
|
||||
fluid_ringbuffer_t *
|
||||
new_fluid_ringbuffer(int count, int elementsize)
|
||||
new_fluid_ringbuffer(int count, size_t elementsize)
|
||||
{
|
||||
fluid_ringbuffer_t *queue;
|
||||
|
||||
|
|
|
@ -33,14 +33,14 @@ struct _fluid_ringbuffer_t
|
|||
fluid_atomic_int_t count; /**< Current count of elements */
|
||||
int in; /**< Index in queue to store next pushed element */
|
||||
int out; /**< Index in queue of next popped element */
|
||||
int elementsize; /**< Size of each element */
|
||||
size_t elementsize; /**< Size of each element */
|
||||
void *userdata;
|
||||
};
|
||||
|
||||
typedef struct _fluid_ringbuffer_t fluid_ringbuffer_t;
|
||||
|
||||
|
||||
fluid_ringbuffer_t *new_fluid_ringbuffer(int count, int elementsize);
|
||||
fluid_ringbuffer_t *new_fluid_ringbuffer(int count, size_t elementsize);
|
||||
void delete_fluid_ringbuffer(fluid_ringbuffer_t *queue);
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue