avformat/img2dec: pass error code and signal EOF

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