Merge pull request #11 from Matroska-Org/eof-in-sizes

detect EOF when reading the element size
This commit is contained in:
Moritz Bunkus 2015-08-21 21:01:15 +02:00
commit 04b34b0dbd

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++;
}