Fixed AMF parser segfaulting on attempted retrieval of non-existant data.

This commit is contained in:
Thulinma 2014-05-09 14:18:08 +02:00
parent 6c54546048
commit 180ac5eb9e

View file

@ -48,6 +48,9 @@ void AMF::Object::addContent(AMF::Object c){
/// Returns AMF::AMF0_DDV_CONTAINER of indice "error" if no object is held at this indice.
/// \param i The indice of the object in this container.
AMF::Object* AMF::Object::getContentP(int i){
if (i >= contents.size()){
return 0;
}
return &contents.at(i);
}