diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2012-10-05 14:44:16 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-10-05 22:43:16 +0400 |
commit | 93ce00b0aea78737e2051e924d5cb538c22cc486 (patch) | |
tree | 38d617fc235e7cb3b186b0fc4e0bbaddaa8d77b7 /src/DSUtil/H264Nalu.cpp | |
parent | d328f49896567c018d215c3574b21fc6ca0dece7 (diff) |
Avoid a potential infinite loop with too small NAL buffers (<4 bytes)
Diffstat (limited to 'src/DSUtil/H264Nalu.cpp')
-rw-r--r-- | src/DSUtil/H264Nalu.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/DSUtil/H264Nalu.cpp b/src/DSUtil/H264Nalu.cpp index 5b7b319a7..611da600d 100644 --- a/src/DSUtil/H264Nalu.cpp +++ b/src/DSUtil/H264Nalu.cpp @@ -40,7 +40,7 @@ void CH264Nalu::SetBuffer(const BYTE* pBuffer, size_t nSize, int nNALSize) bool CH264Nalu::MoveToNextAnnexBStartcode()
{
if (m_nSize < 4) {
- return false;
+ goto notfound;
}
size_t nBuffEnd = m_nSize - 4;
@@ -52,6 +52,7 @@ bool CH264Nalu::MoveToNextAnnexBStartcode() }
}
+notfound:
m_nCurPos = m_nSize;
return false;
}
|