avcodec/ansi: Check x/y

This prevents out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/ansi: Fix right/bottom end checks

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>