Fix SIGABRT when requesting and AMF object out of bounds

Change-Id: I9589ae61dfd28b7477e59c3d519eb114639741cb
This commit is contained in:
Marco van Dijk 2023-01-10 11:18:25 +01:00
parent 67168b9644
commit 24e51ba7f3

View file

@ -57,6 +57,7 @@ AMF::Object *AMF::Object::getContentP(unsigned int i){
/// Returns a 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::getContent(unsigned int i){
if (i >= contents.size()){return AMF::Object("error", AMF0_DDV_CONTAINER);}
return contents.at(i);
}