the val end is useless!
Due to that the val sceneCount is set based on the value from file (r->getEncodedU32()), this value can be faked!
In the loop below, for( int i=0; i<sceneCount; i++ ), it will execute Scene::get many times without checking.
So Heap Out-of-bound Read will happen, which may cause memory leaking!
poc: https://drive.google.com/open?id=1QtKIySFez4q1XG7UzRAOwN0cZ_s3urhd asan: https://drive.google.com/open?id=1lrD-UBZEKFZggTyIUtYcdQQJzN9fkAJD
the val end is useless! Due to that the val sceneCount is set based on the value from file (r->getEncodedU32()), this value can be faked! In the loop below, for( int i=0; i<sceneCount; i++ ), it will execute Scene::get many times without checking. So Heap Out-of-bound Read will happen, which may cause memory leaking!