mirror of https://github.com/mpv-player/mpv
drm_prime: remove off by one when allocating new ref counter
This commit is contained in:
parent
d1e55a0e87
commit
43b702d707
|
@ -130,10 +130,9 @@ void drm_prime_add_handle_ref(struct drm_prime_handle_refs *handle_refs,
|
|||
if (handle) {
|
||||
if (handle > handle_refs->size) {
|
||||
MP_TARRAY_GROW(handle_refs->ctx, handle_refs->handle_ref_count,
|
||||
handle);
|
||||
memset(&handle_refs->handle_ref_count[handle_refs->size + 1], 0,
|
||||
(handle - handle_refs->size)
|
||||
* sizeof(handle_refs->handle_ref_count[0]));
|
||||
handle - 1);
|
||||
uint32_t *p = handle_refs->handle_ref_count;
|
||||
memset(&p[handle_refs->size], 0, (handle - handle_refs->size) * sizeof(p[0]));
|
||||
handle_refs->size = handle;
|
||||
}
|
||||
handle_refs->handle_ref_count[handle - 1]++;
|
||||
|
|
Loading…
Reference in New Issue