diff options
author | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2016-02-03 12:10:37 +0100 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2016-02-03 12:10:37 +0100 |
commit | d4590dda7776ec99e4e879c47b3372a5f4b13dcd (patch) | |
tree | 5319f997c7cd31d610ce5ed80c847bd7d6d043fa /media/libstagefright/codecs/on2/enc | |
parent | 998f3a696f0d671832624637c771e3bda3e0c9f5 (diff) | |
parent | fda1413978cabfafdf184c02aa20d2fd8c095616 (diff) | |
download | frameworks_av-d4590dda7776ec99e4e879c47b3372a5f4b13dcd.zip frameworks_av-d4590dda7776ec99e4e879c47b3372a5f4b13dcd.tar.gz frameworks_av-d4590dda7776ec99e4e879c47b3372a5f4b13dcd.tar.bz2 |
Merge branch 'cm-13.0' of https://github.com/CyanogenMod/android_frameworks_av into replicant-6.0replicant-6.0-alpha-0003replicant-6.0-alpha-0002
Diffstat (limited to 'media/libstagefright/codecs/on2/enc')
-rw-r--r-- | media/libstagefright/codecs/on2/enc/SoftVPXEncoder.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/media/libstagefright/codecs/on2/enc/SoftVPXEncoder.cpp b/media/libstagefright/codecs/on2/enc/SoftVPXEncoder.cpp index e654843..410f9d0 100644 --- a/media/libstagefright/codecs/on2/enc/SoftVPXEncoder.cpp +++ b/media/libstagefright/codecs/on2/enc/SoftVPXEncoder.cpp @@ -26,6 +26,10 @@ #include <media/stagefright/foundation/ADebug.h> #include <media/stagefright/MediaDefs.h> +#ifndef INT32_MAX +#define INT32_MAX 2147483647 +#endif + namespace android { template<class T> @@ -315,6 +319,11 @@ status_t SoftVPXEncoder::initEncoder() { if (mColorFormat != OMX_COLOR_FormatYUV420Planar || mInputDataIsMeta) { free(mConversionBuffer); + mConversionBuffer = NULL; + if (((uint64_t)mWidth * mHeight) > ((uint64_t)INT32_MAX / 3)) { + ALOGE("b/25812794, Buffer size is too big."); + return UNKNOWN_ERROR; + } mConversionBuffer = (uint8_t *)malloc(mWidth * mHeight * 3 / 2); if (mConversionBuffer == NULL) { ALOGE("Allocating conversion buffer failed."); |