mjpegdec: check h/v_count, fix context becoming inconsistent and causing out of array accesses.

This also fixes a long standing comment in the code.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
