Subject: | Mapping STL containers to array tries to extend the AV to (0 - 1) elements when the container is empty. |
Mapping an empty STL container to an array calls av_extend with a key of container.size(0) - 1 which can cause an out of memory error.
const unsigned int len = $var.size();
av_extend(av, len-1);
should be
should be
const unsigned int len = $var.size();
if (len > 0)
if (len > 0)
av_extend(av, len-1);