1
0
Fork 0

MatroskaParser: check more allocations

This commit is contained in:
Hendrik Leppkes 2022-10-12 10:58:09 +02:00
parent b5f46fa671
commit b289c40d13
Signed by: hendrik
GPG Key ID: 846079A4B0A7C1B5
1 changed files with 4 additions and 0 deletions

View File

@ -1713,6 +1713,8 @@ static void parseTrackEntry(MatroskaFile *mf,ulonglong toplen) {
ncplen = zs.total_out;
ncp = mf->cache->memalloc(mf->cache, ncplen);
if (ncp == NULL)
errorjmp(mf, "Out of memory");
inflateReset(&zs);
@ -2532,6 +2534,8 @@ found:
qe->Position = v;
qe->Length = sizes[i];
qe->Data = (char *)mf->cache->memalloc(mf->cache,qe->Length + 16);
if (qe->Data == NULL)
errorjmp(mf, "Out of memory");
readbytes(mf, qe->Data, qe->Length);
qe->flags = FRAME_UNKNOWN_END | FRAME_KF;
if (i == nframes-1 && gap)