sgidec: fix error free end detection.
Fixes Ticket1506 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>