diff options
author | Tom Taylor <tomtaylor@google.com> | 2017-01-04 09:42:37 -0800 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2020-12-03 17:04:29 +0100 |
commit | 7c1e26889714e0c1fe8f42080d4a1ce9245fcc4a (patch) | |
tree | edd63274c2b1537a8e2feb6e60ff43febb32b33b | |
parent | 23735f6e3e6b08000d0b5cf17562fb78e0b0b789 (diff) | |
download | packages_apps_Messaging-7c1e26889714e0c1fe8f42080d4a1ce9245fcc4a.tar.gz packages_apps_Messaging-7c1e26889714e0c1fe8f42080d4a1ce9245fcc4a.tar.bz2 packages_apps_Messaging-7c1e26889714e0c1fe8f42080d4a1ce9245fcc4a.zip |
33388925 Mismatched new vs delete in framesequence library
* The array allocations neglected to include [] so delete, instead
of delete [] would get called.
* Test
Manual
- tested sending a large gif that would invoke the GifTranscoder library
to make the gif smaller.
Bug: 33388925
CVE-2017-0476
Change-Id: I1e200e470d66ae615ffe9340ff9c049eaa73f63c
(cherry picked from commit 837474a376a4599d57f791966080f93ca7afaf67)
(cherry picked from commit 8ba22b48ebff50311d7eaa8d512f9d507f0bdd0d)
-rw-r--r-- | jni/GifTranscoder.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/jni/GifTranscoder.cpp b/jni/GifTranscoder.cpp index 1f329f7..b03d319 100644 --- a/jni/GifTranscoder.cpp +++ b/jni/GifTranscoder.cpp @@ -144,10 +144,10 @@ bool GifTranscoder::resizeBoxFilter(GifFileType* gifIn, GifFileType* gifOut) { std::vector<GifByteType> srcBuffer(gifIn->SWidth * gifIn->SHeight); // Buffer for rendering images from the input GIF. - std::unique_ptr<ColorARGB> renderBuffer(new ColorARGB[gifIn->SWidth * gifIn->SHeight]); + std::unique_ptr<ColorARGB[]> renderBuffer(new ColorARGB[gifIn->SWidth * gifIn->SHeight]); // Buffer for writing new images to output GIF (one row at a time). - std::unique_ptr<GifByteType> dstRowBuffer(new GifByteType[gifOut->SWidth]); + std::unique_ptr<GifByteType[]> dstRowBuffer(new GifByteType[gifOut->SWidth]); // Many GIFs use DISPOSE_DO_NOT to make images draw on top of previous images. They can also // use DISPOSE_BACKGROUND to clear the last image region before drawing the next one. We need |