I think it looks reasonable, though I don’t see what inputOutPadDims is. Have you tried running in assert mode, to see if it hits an assertion instead of seg faulting? Or have you tried running in a debugger to see where the seg fault is?