fix out-of-bounds access of array

CID:27907
make sure that index never exceeds range

by swapping range-check and array-access

CID:27908
CID:27909
initialize vchannel_done to FALSE

CID:27948
trying to make a copy instead of wrapping a pointer

CID:28029
fixed memleaks

CID:27810
CID:27811
CID:27812
CID:27813
CID:27815,27816,27817
CID:27821,27822
CID:27824
document missing break in switch

CID:27887
fixing typo

CID:27809
fixed sizeof() argument when freeing

CID:27939
fixed typos introduced when fixing memleaks
added missing semicolon...

ouch, how did i commit this?
fixed not-found handling of GemState::keys

if iterator==end(), then the key was not found, so we cannot
get the value...

CID:27877
test whether jpeg_write_scanlines could write at least 1 line

rather than <0 (since write_scanlines returns uint...)

CID:27901
check atom_getint()<0 before assigning to uing

CID:27901
checking signedness for atom_getint()

check sign of atom_getint() before assigning to uint

CID:27987
prevent integer overflow in multiplication

CID:27905
initializing member data

CID:28023
initialize m_alist

CID:28022
initialize member variables

CID:28021
initialize members

CID:28020,28016,28015,28013,28010,28009