parser: add NULL checks and simplify error handling
parser: add NULL checks and simplify error handling

ShiftMediaProject/libaacs,ShiftMediaProject/libaacs,rraptorr/libaacs,mwgoldsmith/aacs,rraptorr/libaacs,mwgoldsmith/aacs