movtextenc: fix pointer messup and out of array accesses

Fixes Ticket2187

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Merge remote-tracking branch 'origin/master' into combined