From 49b98e865007bbbfd5780b301a68daa7b3800ec3 Mon Sep 17 00:00:00 2001 From: ckitagawa Date: Fri, 24 Jan 2020 15:39:02 -0500 Subject: [PATCH] Fix nullptr de-reference failure if both blobs in a subset test are 0 in size --- test/api/hb-subset-test.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/api/hb-subset-test.h b/test/api/hb-subset-test.h index 4aa6d6cb9..cdd41ed88 100644 --- a/test/api/hb-subset-test.h +++ b/test/api/hb-subset-test.h @@ -99,7 +99,10 @@ hb_subset_test_check (hb_face_t *expected, expected_blob = hb_face_reference_table (expected, table); actual_blob = hb_face_reference_table (actual, table); fprintf(stderr, "comparing %c%c%c%c, expected %d bytes, actual %d bytes\n", HB_UNTAG(table), hb_blob_get_length(expected_blob), hb_blob_get_length (actual_blob)); - hb_test_assert_blobs_equal (expected_blob, actual_blob); + + if (hb_blob_get_length (expected_blob) != 0 || + hb_blob_get_length (actual_blob) != 0) + hb_test_assert_blobs_equal (expected_blob, actual_blob); hb_blob_destroy (expected_blob); hb_blob_destroy (actual_blob); }