This prevents overflows with 12bit jpegs Fixes Ticket2952 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>