aboutsummaryrefslogtreecommitdiffstats
path: root/main/libass/CVE-2016-7972.patch
blob: 538066254c43af783eb53c3d48c1e6e188303ecd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From aa54e0b59200a994d50a346b5d7ac818ebcf2d4b Mon Sep 17 00:00:00 2001
From: Grigori Goronzy <greg@chown.ath.cx>
Date: Tue, 4 Oct 2016 02:35:26 +0200
Subject: [PATCH] shaper: fix reallocation

Update the variable that tracks the allocated size. This potentially
improves performance and avoid some side effects, which lead to
undefined behavior in some cases.

Fixes fuzzer test case id:000051,sig:11,sync:fuzzer3,src:004221.
---
 libass/ass_shaper.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libass/ass_shaper.c b/libass/ass_shaper.c
index 2707b23..5f24c5a 100644
--- a/libass/ass_shaper.c
+++ b/libass/ass_shaper.c
@@ -100,6 +100,7 @@ static bool check_allocations(ASS_Shaper *shaper, size_t new_size)
             !ASS_REALLOC_ARRAY(shaper->emblevels, new_size) ||
             !ASS_REALLOC_ARRAY(shaper->cmap, new_size))
             return false;
+        shaper->n_glyphs = new_size;
     }
     return true;
 }
-- 
2.7.4