truemotion1: use av_freep()

Signed-off-by: Paul B Mahol <onemda@gmail.com>
truemotion1: check av_fast_malloc() return value

Signed-off-by: Paul B Mahol <onemda@gmail.com>
jpeg2000: check log2_cblk dimensions

Fixes out of array access
Fixes Ticket2895

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>