gdImageColorMatch in gdcolormatch.c in the GD Graphics Library (aka LibGD) 2.2.5 has a heap-based buffer overflow. This can be exploited by an attacker who is able to trigger calls to the function with crafted image data (CVE-2019-6977).
The GD Graphics Library (aka LibGD) 2.2.5 has a double free in the gdImage*Ptr() functions in gdgifout.c, gdjpeg.c, and gdwbmp.c (CVE-2019-6978).