cpml: fix potential bug
Solve "length may be used uninitialized in this function" by avoiding quitting early on if num_data is 0.