Fix possible buffer pointer overruns. Back to zero when it's equal
or over the buffer size.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
/* Read out playback position */
position = atc->pcm_playback_position(atc, apcm);
position = bytes_to_frames(runtime, position);
+ if (position >= runtime->buffer_size)
+ position = 0;
return position;
}
/* Read out playback position */
position = atc->pcm_capture_position(atc, apcm);
position = bytes_to_frames(runtime, position);
+ if (position >= runtime->buffer_size)
+ position = 0;
return position;
}