Commit d7bb1cd7 authored by Wei Jia's avatar Wei Jia
Browse files

libstagefright: fix overflow in pvdec_api.cpp.

Bug: 20674086
Change-Id: Ie2c711865c3b92f3fa2f3c7a436fa0e3687eb8b3
parent f271ddd4
......@@ -335,7 +335,7 @@ Bool PVAllocVideoData(VideoDecControls *decCtrl, int width, int height, int nLay
video->prevVop->uChan = video->prevVop->yChan + size;
video->prevVop->vChan = video->prevVop->uChan + (size >> 2);
#else
if (size > INT32_MAX / 3 * 2) {
if (size > INT32_MAX / 3) {
return PV_FALSE;
}
video->currVop->yChan = (PIXEL *) oscl_malloc(size * 3 / 2); /* Allocate memory for all VOP OKA 3/2/1*/
......@@ -365,7 +365,7 @@ Bool PVAllocVideoData(VideoDecControls *decCtrl, int width, int height, int nLay
{
oscl_memset(video->prevEnhcVop, 0, sizeof(Vop));
#ifndef PV_MEMORY_POOL
if (size > INT32_MAX / 3 * 2) {
if (size > INT32_MAX / 3) {
return PV_FALSE;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment