diff options
author | Chih-Wei Huang <cwhuang@linux.org.tw> | 2013-01-10 20:52:57 +0800 |
---|---|---|
committer | Chih-Wei Huang <cwhuang@android-x86.org> | 2013-01-10 21:04:50 +0800 |
commit | a93c8c9c89ba679cf312c7d082913121bb5543c2 (patch) | |
tree | c70bb3650465a38237dbbe113c4ba71da410280a | |
parent | 12834fe289e8173e94f31603fa6d313abe56ad70 (diff) | |
download | frameworks_av-a93c8c9c89ba679cf312c7d082913121bb5543c2.zip frameworks_av-a93c8c9c89ba679cf312c7d082913121bb5543c2.tar.gz frameworks_av-a93c8c9c89ba679cf312c7d082913121bb5543c2.tar.bz2 |
Avoid a building error
&pDwmModule->config may equal to pConfig that triggers
a building error using gcc 4.7:
In file included from bionic/libc/include/signal.h:33:0,
from bionic/libc/include/sys/select.h:34,
from bionic/libc/include/unistd.h:34,
from system/core/include/cutils/log.h:34,
from frameworks/av/media/libeffects/downmix/EffectDownmix.c:19:
In function 'memcpy',
inlined from 'Downmix_Configure' at frameworks/av/media/libeffects/downmix/EffectDownmix.c:651:11,
inlined from 'Downmix_Init' at frameworks/av/media/libeffects/downmix/EffectDownmix.c:605:9,
inlined from 'DownmixLib_Create' at frameworks/av/media/libeffects/downmix/EffectDownmix.c:233:9:
bionic/libc/include/string.h:114:31: error: call to '__memcpy_overlap_error' declared with attribute error: memcpy called with overlapping regions
Change-Id: Ia6c4aab72e38d00d8d526f3b56fc03b6530b4e44
-rw-r--r-- | media/libeffects/downmix/EffectDownmix.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/media/libeffects/downmix/EffectDownmix.c b/media/libeffects/downmix/EffectDownmix.c index 5bf052a..366a78b 100644 --- a/media/libeffects/downmix/EffectDownmix.c +++ b/media/libeffects/downmix/EffectDownmix.c @@ -648,7 +648,9 @@ int Downmix_Configure(downmix_module_t *pDwmModule, effect_config_t *pConfig, bo return -EINVAL; } - memcpy(&pDwmModule->config, pConfig, sizeof(effect_config_t)); + if (&pDwmModule->config != pConfig) { + memcpy(&pDwmModule->config, pConfig, sizeof(effect_config_t)); + } if (init) { pDownmixer->type = DOWNMIX_TYPE_FOLD; |