((ULONG*)td_ulObject)[iFr] is fishy - and ULONG td_ulObject already is in an union with ULONG* td_pulObjects, so use td_pulObjects when appropriate (i.e. if td_ctFrames>1) Also fixed some checks accordingly.