[subset] fix fuzzer found underflow when heap push fails.

Fixes https://oss-fuzz.com/testcase-detail/5148625505746944.
This commit is contained in:
Garret Rieger 2022-05-19 22:59:51 +00:00 committed by Behdad Esfahbod
parent f1bf14ea89
commit 73b8360dcf
1 changed files with 1 additions and 0 deletions

View File

@ -51,6 +51,7 @@ struct hb_priority_queue_t
void insert (int64_t priority, unsigned value) void insert (int64_t priority, unsigned value)
{ {
heap.push (item_t (priority, value)); heap.push (item_t (priority, value));
if (unlikely (heap.in_error ())) return;
bubble_up (heap.length - 1); bubble_up (heap.length - 1);
} }