]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Added the check to avoid NULL pointer dereference in snd_pcm_areas_copy
authorJaroslav Kysela <perex@perex.cz>
Tue, 10 Apr 2001 08:26:38 +0000 (08:26 +0000)
committerJaroslav Kysela <perex@perex.cz>
Tue, 10 Apr 2001 08:26:38 +0000 (08:26 +0000)
src/pcm/pcm_share.c

index 935f57c93f26f05fdf25e8adeb33bbd07c0bb0f7..c5958dd264357b8be522fa3456f9c426c519a191 100644 (file)
@@ -865,10 +865,11 @@ static int snd_pcm_share_start(snd_pcm_t *pcm)
                        snd_pcm_uframes_t cont = pcm->buffer_size - offset;
                        if (cont < frames)
                                frames = cont;
-                       snd_pcm_areas_copy(pcm->running_areas, offset,
-                                          pcm->stopped_areas, xfer,
-                                          pcm->channels, frames,
-                                          pcm->format);
+                       if (pcm->stopped_areas != NULL)
+                               snd_pcm_areas_copy(pcm->running_areas, offset,
+                                                  pcm->stopped_areas, xfer,
+                                                  pcm->channels, frames,
+                                                  pcm->format);
                        xfer += frames;
                }
                snd_pcm_mmap_appl_forward(pcm, hw_avail);