Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libebml2: fix misc. leaks #190

Merged
merged 3 commits into from
Dec 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libebml2/ebmlmaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ static err_t ReadData(ebml_master *Element, struct stream *Input, const ebml_par
Stream_Seek(Input,EBML_ElementPositionEnd(SubElement),SEEK_SET);
if (Stream_Read(Input, CRCData, CRCDataSize, NULL)!=ERR_NONE)
{
StreamClose(ReadStream);
ReadStream=Input; // revert back to normal reading
ArrayClear(&CrcBuffer);
}
Expand Down Expand Up @@ -404,6 +405,7 @@ static err_t ReadData(ebml_master *Element, struct stream *Input, const ebml_par
if (CRCData!=NULL)
{
Element->CheckSumStatus = EBML_CRCMatches(CRCElement, CRCData, CRCDataSize)?2:1;
NodeDelete((node*)CRCElement);
if (CRCData == ARRAYBEGIN(CrcBuffer,uint8_t))
{
StreamClose(ReadStream);
Expand All @@ -416,6 +418,7 @@ static err_t ReadData(ebml_master *Element, struct stream *Input, const ebml_par
{
assert(SubElement!=NULL);
Stream_Seek(Input,SubElement->ElementPosition,SEEK_SET);
NodeDelete((node*)SubElement); // forget about it, it will be read again later
}
return ERR_NONE;
}
Expand Down
Loading