[Serial] Fixed a bug in the method to save raw data frames.

There was a size overflow in the computation of the indexes.