detect EOF when reading the element size, similar to when reading the element id

This commit is contained in:
Steve Lhomme 2015-08-21 15:42:12 +02:00
parent 8427995f27
commit 642c3c4e27

View File

@ -417,7 +417,10 @@ EbmlElement * EbmlElement::FindNextElement(IOCallback & DataStream, const EbmlSe
bFound = false;
break;
}
ReadSize += DataStream.read(&PossibleIdNSize[SizeIdx++], 1);
if( DataStream.read( &PossibleIdNSize[SizeIdx++], 1 ) == 0 ) {
return NULL; // no more data ?
}
ReadSize++;
PossibleSizeLength++;
}