jp2/opj_decompress.c in OpenJPEG through 2.3.1 has a use-after-free that can be triggered if there is a mix of valid and invalid files in a directory operated on by the decompressor. Triggering a double-free may also be possible. This is related to calling opj_image_destroy twice.
Created openjpeg tracking bugs for this issue:
Affects: fedora-all [bug 1852871]
Created openjpeg2 tracking bugs for this issue:
Affects: epel-all [bug 1852870]
This issue has been addressed in the following products:
Red Hat Enterprise Linux 8
Via RHSA-2021:4251 https://access.redhat.com/errata/RHSA-2021:4251