fix array access and add bound check (but nothing is implemented in case of fail).
fix array access and add bound check (but nothing is implemented in case of fail).

bpr/SDC,sidmutha/SDC,schancel/SDC,sidmutha/SDC,schancel/SDC,JohanEngelen/SDC,bpr/SDC,SDC-Developers/SDC,bpr/SDC,JohanEngelen/SDC,DmitryOlshansky/SDC,UplinkCoder/SDC,deadalnix/SDC,schancel/SDC,DmitryOlshansky/SDC,DmitryOlshansky/SDC,JohanEngelen/SDC,deadalnix/SDC,sidmutha/SDC,UplinkCoder/SDC,SDC-Developers/SDC,deadalnix/SDC,UplinkCoder/SDC,SDC-Developers/SDC