Loading media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,10 @@ #include <inttypes.h> #ifndef INT32_MAX #define INT32_MAX 2147483647 #endif namespace android { template<class T> Loading Loading @@ -137,6 +141,11 @@ OMX_ERRORTYPE SoftMPEG4Encoder::initEncParams() { if (mColorFormat != OMX_COLOR_FormatYUV420Planar || mInputDataIsMeta) { // Color conversion is needed. free(mInputFrameData); mInputFrameData = NULL; if (((uint64_t)mWidth * mHeight) > ((uint64_t)INT32_MAX / 3)) { ALOGE("b/25812794, Buffer size is too big."); return OMX_ErrorBadParameter; } mInputFrameData = (uint8_t *) malloc((mWidth * mHeight * 3 ) >> 1); CHECK(mInputFrameData != NULL); Loading media/libstagefright/codecs/on2/enc/SoftVPXEncoder.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -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> Loading Loading @@ -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."); Loading Loading
media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,10 @@ #include <inttypes.h> #ifndef INT32_MAX #define INT32_MAX 2147483647 #endif namespace android { template<class T> Loading Loading @@ -137,6 +141,11 @@ OMX_ERRORTYPE SoftMPEG4Encoder::initEncParams() { if (mColorFormat != OMX_COLOR_FormatYUV420Planar || mInputDataIsMeta) { // Color conversion is needed. free(mInputFrameData); mInputFrameData = NULL; if (((uint64_t)mWidth * mHeight) > ((uint64_t)INT32_MAX / 3)) { ALOGE("b/25812794, Buffer size is too big."); return OMX_ErrorBadParameter; } mInputFrameData = (uint8_t *) malloc((mWidth * mHeight * 3 ) >> 1); CHECK(mInputFrameData != NULL); Loading
media/libstagefright/codecs/on2/enc/SoftVPXEncoder.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -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> Loading Loading @@ -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."); Loading