Skip to content

Commit 942f000

Browse files
TRDarioSiegeLord
authored andcommitted
More misc. fixes
1 parent 65cce44 commit 942f000

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

addons/acodec/voc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ ALLEGRO_SAMPLE *_al_load_voc_f(ALLEGRO_FILE *file)
277277
/*
278278
* Let's allocate at least the first block's bytes;
279279
*/
280-
buffer_size = vocdata->samples * vocdata->sample_size;
280+
buffer_size = (size_t)vocdata->samples * vocdata->sample_size;
281281
buffer = al_malloc(buffer_size);
282282
if (!buffer) {
283283
return NULL;
@@ -304,7 +304,7 @@ ALLEGRO_SAMPLE *_al_load_voc_f(ALLEGRO_FILE *file)
304304
bytestoread = 0;
305305
READNBYTES(vocdata->file, bytestoread, 2, NULL);
306306
READNBYTES(vocdata->file, x, 1, NULL);
307-
bytestoread += x<<16;
307+
bytestoread += (size_t)x << 16;
308308
/* increase subsequently storage */
309309
buffer_size += bytestoread;
310310
buffer = al_realloc(buffer, buffer_size);

addons/primitives/primitives.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,12 @@ ALLEGRO_INDEX_BUFFER* al_create_index_buffer(int index_size,
313313
*/
314314
void al_destroy_vertex_buffer(ALLEGRO_VERTEX_BUFFER* buffer)
315315
{
316-
int flags = al_get_display_flags(al_get_current_display());
317-
ASSERT(addon_initialized);
318-
319316
if (buffer == 0)
320317
return;
321318

319+
int flags = al_get_display_flags(al_get_current_display());
320+
ASSERT(addon_initialized);
321+
322322
al_unlock_vertex_buffer(buffer);
323323

324324
if (flags & ALLEGRO_OPENGL) {
@@ -335,12 +335,12 @@ void al_destroy_vertex_buffer(ALLEGRO_VERTEX_BUFFER* buffer)
335335
*/
336336
void al_destroy_index_buffer(ALLEGRO_INDEX_BUFFER* buffer)
337337
{
338-
int flags = al_get_display_flags(al_get_current_display());
339-
ASSERT(addon_initialized);
340-
341338
if (buffer == 0)
342339
return;
343340

341+
int flags = al_get_display_flags(al_get_current_display());
342+
ASSERT(addon_initialized);
343+
344344
al_unlock_index_buffer(buffer);
345345

346346
if (flags & ALLEGRO_OPENGL) {

0 commit comments

Comments
 (0)