Multiple integer overflows in the (1) jas_realloc function in base/jas_malloc.c and (2) mem_resize function in base/jas_stream.c in JasPer before 1.900.22 allow remote attackers to cause a denial of service via a crafted image, which triggers use after free vulnerabilities.
https://usn.ubuntu.com/3693-1/
https://security.gentoo.org/glsa/201707-07
https://github.com/mdadams/jasper/commit/634ce8e8a5accc0fa05dd2c20d42b4749d4b2735
https://bugzilla.redhat.com/show_bug.cgi?id=1393882
https://blogs.gentoo.org/ago/2016/11/07/jasper-use-after-free-in-jas_realloc-jas_malloc-c
https://access.redhat.com/errata/RHSA-2017:1208