From 24e51ba7f32b44ed72d5668f0ccb02e2b416fdee Mon Sep 17 00:00:00 2001 From: Marco van Dijk Date: Tue, 10 Jan 2023 11:18:25 +0100 Subject: [PATCH] Fix SIGABRT when requesting and AMF object out of bounds Change-Id: I9589ae61dfd28b7477e59c3d519eb114639741cb --- lib/amf.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/amf.cpp b/lib/amf.cpp index 57e82518..54863c93 100644 --- a/lib/amf.cpp +++ b/lib/amf.cpp @@ -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); }