avformat/img2dec: pass error code and signal EOF