mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-03-15 21:17:00 -04:00
Merge pull request #1841 from jpark37/index-size-fix
libobs: Fix GS_UNSIGNED_LONG definition
This commit is contained in:
@@ -38,7 +38,7 @@ gs_indexbuffer_t *device_indexbuffer_create(gs_device_t *device,
|
||||
uint32_t flags)
|
||||
{
|
||||
struct gs_index_buffer *ib = bzalloc(sizeof(struct gs_index_buffer));
|
||||
size_t width = type == GS_UNSIGNED_LONG ? sizeof(long) : sizeof(short);
|
||||
size_t width = type == GS_UNSIGNED_LONG ? 4 : 2;
|
||||
|
||||
ib->device = device;
|
||||
ib->data = indices;
|
||||
|
||||
@@ -1517,9 +1517,7 @@ gs_indexbuffer_t *gs_indexbuffer_create(enum gs_index_type type,
|
||||
return NULL;
|
||||
|
||||
if (indices && num && (flags & GS_DUP_BUFFER) != 0) {
|
||||
size_t size = type == GS_UNSIGNED_SHORT
|
||||
? sizeof(unsigned short)
|
||||
: sizeof(unsigned long);
|
||||
size_t size = type == GS_UNSIGNED_SHORT ? 2 : 4;
|
||||
indices = bmemdup(indices, size * num);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user