<p></p>
<p><a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/elextr/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/elextr">@elextr</a> for the moment your hint doesn't make much sense to me, you're just point out that a 0×H image will have 0 bytes of data, which makes sense.  I don't see how it would account for accessing past the buffer, as the given size is 0 in one direction.  Well, of course the can be a bug some other place, and likely is, but it makes perfect sense the data is 0 bytes.</p>
<p>Or maybe I'm just not C++-literate enough, but <code>&zeroLengthMemory[0]</code> should not cause any issue.  Though, maybe the problem is that <code>operator[0]</code> actually checks the value can be dereferenced, in which case it cannot…</p>
<p>Meh, writing this makes me think that either:</p>
<ul>
<li>with a C++ vector, <code>&vector[0]</code> is not equivalent to getting a raw pointer on the vector's data</li>
<li>glibc++ has a bug in that it should not assert in this case (yet, I don't see how it could then assert for valid cases)</li>
</ul>
<p>I don't think there is an actual bug in accessing the memory as Valgrind's memcheck doesn't report errors; so I guess the calling code (at which I didn't look) does not access the memeory past its size.<br>
I guess we <em>could</em> special-case the code not to dereference, but that sounds weird to the C guy I am :)</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany-plugins/issues/1041#issuecomment-739874149">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJZKE7Y54BXUHNFL4HDSTS7WZANCNFSM4UHMIKQQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAIOWJ3R63DJUS6QHATJVT3STS7WZA5CNFSM4UHMIKQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFQMZKZI.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany-plugins/issues/1041#issuecomment-739874149",
"url": "https://github.com/geany/geany-plugins/issues/1041#issuecomment-739874149",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>