summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp
diff options
context:
space:
mode:
authorPawin Vongmasa <pawin@google.com>2016-07-18 20:12:02 -0700
committergitbuildkicker <android-build@google.com>2016-08-25 21:56:08 -0700
commitb52c75787d068a92c961d29f973e975b7651abe5 (patch)
treece9839686958e5a7e0c88b4db9cf7ed933dbd3f6 /media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp
parent6679b5088f36693f5708dcaedd0c9ab7c66df27c (diff)
downloadframeworks_av-b52c75787d068a92c961d29f973e975b7651abe5.zip
frameworks_av-b52c75787d068a92c961d29f973e975b7651abe5.tar.gz
frameworks_av-b52c75787d068a92c961d29f973e975b7651abe5.tar.bz2
SoftMPEG4: Check the buffer size before writing the reference frame.
Also prevent overflow in SoftMPEG4 and division by zero in SoftMPEG4Encoder. Bug: 30033990 Change-Id: I7701f5fc54c2670587d122330e5dc851f64ed3c2 (cherry picked from commit 695123195034402ca76169b195069c28c30342d3)
Diffstat (limited to 'media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp')
-rw-r--r--media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp b/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp
index 7638bb7..2eb51c9 100644
--- a/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp
+++ b/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp
@@ -116,6 +116,10 @@ OMX_ERRORTYPE SoftMPEG4Encoder::initEncParams() {
ALOGE("Failed to get default encoding parameters");
return OMX_ErrorUndefined;
}
+ if (mFramerate == 0) {
+ ALOGE("Framerate should not be 0");
+ return OMX_ErrorUndefined;
+ }
mEncParams->encMode = mEncodeMode;
mEncParams->encWidth[0] = mWidth;
mEncParams->encHeight[0] = mHeight;