- /* If it was, we only check the lost_size. This is the lost padding at the end of
- * the subbuffer. */
- valid_length = (unsigned long)buf->subbuf_size - header->lost_size;
+ /* If it was, we only check the data_size. This is the amount of valid data at
+ * the beginning of the subbuffer. */
+ valid_length = header->data_size;