Additional decode input size checks
if (name.av_len <= 0)
return nRes;
+ nSize -= nRes;
+ if (nSize <= 0)
+ return -1;
prop->p_name = name;
pBuffer += nRes;
- nSize -= nRes;
}
/* decode */
__FUNCTION__, (unsigned char)(*pBuffer), pBuffer);
return -1;
}
+ if (nSize < 0)
+ return -1;
return nOriginalSize - nSize;
}
int nRes;
nArrayLen--;
+ if (nSize <= 0)
+ {
+ bError = TRUE;
+ break;
+ }
nRes = AMFProp_Decode(&prop, pBuffer, nSize, bDecodeName);
if (nRes == -1)
- bError = TRUE;
+ {
+ bError = TRUE;
+ break;
+ }
else
{
nSize -= nRes;
nRes = AMFProp_Decode(&prop, pBuffer, nSize, bDecodeName);
if (nRes == -1)
- bError = TRUE;
+ {
+ bError = TRUE;
+ break;
+ }
else
{
nSize -= nRes;
+ if (nSize < 0)
+ {
+ bError = TRUE;
+ break;
+ }
pBuffer += nRes;
AMF_AddProp(obj, &prop);
}