Created attachment 75004 [details]
Test program to reproduce the segfault
When glBitmap is called with a GL_PIXEL_UNPACK_BUFFER target, it segfaults in accum_bitmap().
Created attachment 75005 [details]
Created attachment 75006 [details] [review]
OK, I've found/fixed the problem. Your patch was incorrect. And your test program has a few bugs too (I'll attach a fixed version).
After the patch has been reviewed I'll commit it. Thanks for the test program!
Created attachment 75047 [details]
Fixed test program.
Fixed with commit 63c30d7e4fd9676c72d5d94640e1e136bd9dd09f
on Mar 26, 2017 at 12:59:35.
(provided by the Example extension).