Commit 828bdd73 authored by Steve Lhomme's avatar Steve Lhomme

return a proper error when we run out of memory

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/foundation_src@534 a6f86f6d-0131-4f8e-9e7b-e335508773d5
parent 3eaba31f
......@@ -1434,7 +1434,11 @@ err_t MATROSKA_BlockReadData(matroska_block *Element, stream *Input)
else
#endif
{
ArrayResize(&Element->Data,(size_t)ARRAYBEGIN(Element->SizeList,int32_t)[0],0);
if (!ArrayResize(&Element->Data,(size_t)ARRAYBEGIN(Element->SizeList,int32_t)[0],0))
{
Err = ERR_OUT_OF_MEMORY;
goto failed;
}
InBuf = ARRAYBEGIN(Element->Data,uint8_t);
if (Header)
{
......@@ -1523,7 +1527,11 @@ err_t MATROSKA_BlockReadData(matroska_block *Element, stream *Input)
else
#endif
{
ArrayResize(&Element->Data,BufSize,0);
if (!ArrayResize(&Element->Data,BufSize,0))
{
Err = ERR_OUT_OF_MEMORY;
goto failed;
}
if (!Header)
{
//assert(BufSize + Element->FirstFrameLocation == Element->Base.Base.DataSize);
......
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