mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-15 19:22:19 +08:00
FLV: Fix error on tag without enough data
This commit is contained in:
parent
bb37dbdd3f
commit
d454418980
|
@ -174,7 +174,16 @@ namespace BililiveRecorder.Flv
|
|||
{
|
||||
foreach (var nalu in this.Nalus)
|
||||
{
|
||||
nalu.NaluHash = BinaryConvertUtilities.ByteArrayToHexString(farmHash64.ComputeHash(buffer, nalu.StartPosition, (int)nalu.FullSize));
|
||||
var bytesLeft = buffer.Length - nalu.StartPosition;
|
||||
|
||||
if (bytesLeft >= nalu.FullSize)
|
||||
{
|
||||
nalu.NaluHash = BinaryConvertUtilities.ByteArrayToHexString(farmHash64.ComputeHash(buffer, nalu.StartPosition, (int)nalu.FullSize));
|
||||
}
|
||||
else
|
||||
{
|
||||
nalu.NaluHash = BinaryConvertUtilities.ByteArrayToHexString(farmHash64.ComputeHash(buffer, nalu.StartPosition, Math.Min(buffer.Length - nalu.StartPosition, (int)nalu.FullSize))) + "-PARTIAL";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user