alsa/0020-minor-malloc-changes.patch
Takashi Iwai 62cc03c4bc Accepting request 225572 from home:tiwai:branches:multimedia:libs
- Update alsa-info.sh to match dmesg with snd_
- Run spec-cleaner
- Add missing Loopback.conf manually
- Upstream fixes: minor clean ups, 2.1 PCM channel config support,
  portability improvements, PCM float format conversion fix,
  fix for ioplug 32bit hwptr wrap, etc.
  0020-minor-malloc-changes.patch
  0021-alsa-lib-minor-typo-in-pcm-doc.patch
  0022-control_hw-fix-potential-memory-leak.patch
  0023-pcm-initialize-pcm_dmix-monotonic-field.patch
  0024-pcm-initialize-monotonic-field-for-dshare-and-dsnoop.patch
  0025-pcm-use-CLOCK_REALTIME-for-non-monotonic-ts.patch
  0026-alsa-lib-heavy-pcm-atomics-cleanup.patch
  0027-conf-Add-basic-infrastructure-for-2.1-surround-sound.patch
  0028-conf-Add-surround-2.1-support-to-all-cards.patch
  0029-Portability-fix-look-for-sys-endian.h-as-well-as-end.patch
  0030-autotools-update-style.patch
  0031-pcm-Insert-linear-to-float-conversion-when-rate-or-c.patch
  0032-pcm-route-Allow-chmap-syntax-for-slave-channels-in-t.patch
  0033-pcm-route-Select-slave-chmap-based-on-ttable-informa.patch
  0034-conf-Allow-2.1-surround-to-use-different-number-of-c.patch
  0035-pcm-Wrap-hw_ptr-to-boundary-in-pcm_ioplug.patch
  0036-src-conf-cards-Add-missing-entry-for-Loopback.conf.patch

OBS-URL: https://build.opensuse.org/request/show/225572
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=152
2014-03-11 11:08:29 +00:00

53 lines
1.8 KiB
Diff

From 670e228c693cbff9714856e5be93a88d137c5c30 Mon Sep 17 00:00:00 2001
From: Olivier Langlois <olivier@trillion01.com>
Date: Thu, 12 Dec 2013 23:47:20 -0500
Subject: [PATCH] minor malloc changes
replace malloc + memset with calloc since calloc may skip the memset if
returned memory comes directly from sbrk()
use malloc instead of malloc if first thing done with allocated memory is
to flip all bits to 1.
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/alisp/alisp.c | 3 +--
src/pcm/pcm_ladspa.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/alisp/alisp.c b/src/alisp/alisp.c
index 1796c33c3faf..3c61bb1754c3 100644
--- a/src/alisp/alisp.c
+++ b/src/alisp/alisp.c
@@ -3202,12 +3202,11 @@ int alsa_lisp(struct alisp_cfg *cfg, struct alisp_instance **_instance)
struct alisp_object *p, *p1;
int i, j, retval = 0;
- instance = (struct alisp_instance *)malloc(sizeof(struct alisp_instance));
+ instance = (struct alisp_instance *)calloc(1, sizeof(struct alisp_instance));
if (instance == NULL) {
nomem();
return -ENOMEM;
}
- memset(instance, 0, sizeof(struct alisp_instance));
instance->verbose = cfg->verbose && cfg->vout;
instance->warning = cfg->warning && cfg->wout;
instance->debug = cfg->debug && cfg->dout;
diff --git a/src/pcm/pcm_ladspa.c b/src/pcm/pcm_ladspa.c
index 0a9c52e975e6..9ce5242e2359 100644
--- a/src/pcm/pcm_ladspa.c
+++ b/src/pcm/pcm_ladspa.c
@@ -1326,7 +1326,7 @@ static int snd_pcm_ladspa_parse_bindings(snd_pcm_ladspa_plugin_t *lplug,
count = (unsigned int)(channel + 1);
}
if (count > 0) {
- array = (unsigned int *)calloc(count, sizeof(unsigned int));
+ array = (unsigned int *)malloc(count * sizeof(unsigned int));
if (! array)
return -ENOMEM;
memset(array, 0xff, count * sizeof(unsigned int));
--
1.9.0