jpeg2000: fix dereferencing invalid pointers during cleanup

CC: libav-stable@libav.org
Found-by: Laurent Butti <laurentb@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
h264: error out from decode_nal_units() when AV_EF_EXPLODE is set

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>