Re: Strange div-by-zero in alsa-lib 1.0.20's snd_pcm_mmap_begin()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Sun, 16 Aug 2009 18:24:35 -0400,
Daniel Chen wrote:
> 
> Hi,
> 
> In https://bugs.launchpad.net/ubuntu/+source/alsa-lib/+bug/412677
> we're debugging an issue where snd_pcm_mmap_begin(), at line 6409 with
> 
> *offset = *pcm->appl.ptr % pcm->buffer_size;
> 
> appears to have pcm->buffer_size == 0. What's the correct approach in
> handling this corner case?

We could add a sanity check in the function, of course.
But relying on it doesn't sound nice.

At least, the caller should be surely at the certain state that the
buffer has been set up, i.e. checking whether snd_pcm_state() returns
SETUP or better condition.


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux