Fixed infinite loop in MP4 analyser when reaching end of file mid-box
This commit is contained in:
parent
7dbd60b208
commit
c70fadd66f
1 changed files with 4 additions and 1 deletions
|
@ -18,7 +18,10 @@ bool AnalyserMP4::parsePacket(){
|
||||||
for (uint64_t i = mp4Buffer.size(); i < needed; ++i){
|
for (uint64_t i = mp4Buffer.size(); i < needed; ++i){
|
||||||
mp4Buffer += std::cin.get();
|
mp4Buffer += std::cin.get();
|
||||||
++curPos;
|
++curPos;
|
||||||
if (!std::cin.good()){mp4Buffer.erase(mp4Buffer.size() - 1, 1);}
|
if (!std::cin.good()){
|
||||||
|
mp4Buffer.erase(mp4Buffer.size() - 1, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue