summaryrefslogtreecommitdiff
path: root/libs/jpegrecoverymap/jpegencoderhelper.cpp
diff options
context:
space:
mode:
author Leon Scroggins III <scroggo@google.com> 2022-12-01 12:33:43 -0500
committer Leon Scroggins III <scroggo@google.com> 2022-12-02 10:12:21 -0500
commitb19461b1d185192958d9f7a5d155e2720e132526 (patch)
treeaa4aa47fb62aa56fc3e6f4bd6e223489387a6349 /libs/jpegrecoverymap/jpegencoderhelper.cpp
parent95538a1ca5818f56ec2292131c9316369b749431 (diff)
Prevent calling new ftl::Optional
This class inherits from std::optional, which does not have a virtual destructor. As such, deleting an object of ftl::Optional using a pointer to its base class has undefined behavior. Prevent this by removing new from ftl::Optional. This is generally not the right way to use it anyway, and in fact this builds as is. Delete new[] while we're at it. This should be enough of a signal not to try to heap allocate these. It's still possible for a programmer to circumvent these deletions, but they prevent the straightforward (broken) use case. Bug: 261035092 Test: make Change-Id: Iafdaf98ed88920162af2b445caf0e4a69be51ab5
Diffstat (limited to 'libs/jpegrecoverymap/jpegencoderhelper.cpp')
0 files changed, 0 insertions, 0 deletions