Skip to content

Commit

Permalink
Убраны бесполезные проверки.
Browse files Browse the repository at this point in the history
  • Loading branch information
v0lt committed Aug 22, 2024
1 parent 12448a9 commit 077702b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/filters/parser/AviSplitter/AviSplitter.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
* (C) 2006-2023 see Authors.txt
* (C) 2006-2024 see Authors.txt
*
* This file is part of MPC-BE.
*
Expand Down Expand Up @@ -609,7 +609,7 @@ HRESULT CAviSplitterFilter::ReIndex(__int64 end, UINT64& Size, DWORD TrackNumber
return E_FAIL;
}

while (S_OK == hr && m_pFile->GetPos() < end && SUCCEEDED(hr) && !m_fAbort) {
while (S_OK == hr && m_pFile->GetPos() < end && !m_fAbort) {
__int64 pos = m_pFile->GetPos();

DWORD id = 0, size;
Expand Down
8 changes: 4 additions & 4 deletions src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ HRESULT CMatroskaSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
}
}
}
} while (m_pBlock->NextBlock() && SUCCEEDED(hr) && !CheckRequest(nullptr) && !bIsParse);
} while (m_pBlock->NextBlock() && !CheckRequest(nullptr) && !bIsParse);

m_pBlock.reset();
m_pCluster.reset();
Expand Down Expand Up @@ -1275,7 +1275,7 @@ HRESULT CMatroskaSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
bIsParse = TRUE;
break;
}
} while (m_pBlock->NextBlock() && SUCCEEDED(hr) && !CheckRequest(nullptr) && !bIsParse);
} while (m_pBlock->NextBlock() && !CheckRequest(nullptr) && !bIsParse);

m_pBlock.reset();
m_pCluster.reset();
Expand Down Expand Up @@ -2568,10 +2568,10 @@ HRESULT CMatroskaSplitterFilter::DeliverMatroskaPacket(std::unique_ptr<CMatroska

const BYTE marker = pData[size - 1];
if ((marker & 0xe0) == 0xc0) {
const BYTE nbytes = 1 + ((marker >> 3) & 0x3);
const BYTE nbytes = 1 + ((marker >> 3) & 0x3); // nbytes only accepts values from 1 to 4
BYTE n_frames = 1 + (marker & 0x7);
const size_t idx_sz = 2 + n_frames * nbytes;
if (size >= idx_sz && pData[size - idx_sz] == marker && nbytes >= 1 && nbytes <= 4) {
if (size >= idx_sz && pData[size - idx_sz] == marker) {
const BYTE *idx = pData + size + 1 - idx_sz;

while (n_frames--) {
Expand Down

0 comments on commit 077702b

Please sign in to comment.