[trunk] fixed memleak in abnormal condition (fixes issue 437)
[trunk] added check for pclr box validity (fixes issue 429)