Commit d4214b50 authored by Geoff Lang's avatar Geoff Lang Committed by Commit Bot

Don't delete the invalid service id.

It was possible to put thing in a bad state by calling glBind* with an
invalid client id (which binds the invalid service id) and then calling
glDelete* with an invalid client id (which deletes the invald service
id).

BUG=785753

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I4628f964e9d14a1d87bc12b1cde3f056acb8314e
Reviewed-on: https://chromium-review.googlesource.com/791011Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519752}
parent 0fb133d7
...@@ -65,8 +65,13 @@ error::Error DeleteHelper(GLsizei n, ...@@ -65,8 +65,13 @@ error::Error DeleteHelper(GLsizei n,
// Don't pass service IDs of objects with a client ID of 0. They are // Don't pass service IDs of objects with a client ID of 0. They are
// emulated and should not be deleteable // emulated and should not be deleteable
if (client_id != 0) { if (client_id != 0) {
service_ids[ii] = id_map->GetServiceIDOrInvalid(client_id); ServiceType service_id = id_map->GetServiceIDOrInvalid(client_id);
id_map->RemoveClientID(client_id); // Don't delete the invalid service ID, if bind-generates-resource is
// enabled then it may be currently used as a placeholder
if (service_id != id_map->invalid_service_id()) {
DCHECK(service_id != 0);
id_map->RemoveClientID(client_id);
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment