diff options
author | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2012-11-15 22:30:47 +0100 |
---|---|---|
committer | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2012-11-15 22:30:47 +0100 |
commit | 51bffadb822b2e08aebe72679af9a2671b3616d9 (patch) | |
tree | 0977be15e771a3de1e8bc46b9eaa5bfc020cdd98 /media | |
parent | adbc9aa457563f7892653bf2d8cb4a60d0f13662 (diff) |
av: Fix compile errorslinaro_android_4.2.1linaro_android_4.2
Don't use memcpy() on areas that may overlap
Fix aliasing violation
Change-Id: Icd54cf12c2485a3d2789d1fb75c3a8a964c4163f
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Diffstat (limited to 'media')
-rw-r--r-- | media/libeffects/downmix/EffectDownmix.c | 2 | ||||
-rw-r--r-- | media/libmediaplayerservice/MediaPlayerFactory.cpp | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/media/libeffects/downmix/EffectDownmix.c b/media/libeffects/downmix/EffectDownmix.c index 0ea3b54b..9e8ea851 100644 --- a/media/libeffects/downmix/EffectDownmix.c +++ b/media/libeffects/downmix/EffectDownmix.c @@ -650,7 +650,7 @@ int Downmix_Configure(downmix_module_t *pDwmModule, effect_config_t *pConfig, bo return -EINVAL; } - memcpy(&pDwmModule->config, pConfig, sizeof(effect_config_t)); + memmove(&pDwmModule->config, pConfig, sizeof(effect_config_t)); if (init) { pDownmixer->type = DOWNMIX_TYPE_FOLD; diff --git a/media/libmediaplayerservice/MediaPlayerFactory.cpp b/media/libmediaplayerservice/MediaPlayerFactory.cpp index 3f69c119..72c6bf45 100644 --- a/media/libmediaplayerservice/MediaPlayerFactory.cpp +++ b/media/libmediaplayerservice/MediaPlayerFactory.cpp @@ -175,12 +175,15 @@ class StagefrightPlayerFactory : int64_t offset, int64_t length, float curScore) { - char buf[20]; + union { + char buf[20]; + long bufl[20/sizeof(long)]; + }; lseek(fd, offset, SEEK_SET); read(fd, buf, sizeof(buf)); lseek(fd, offset, SEEK_SET); - long ident = *((long*)buf); + const long ident = bufl[0]; // Ogg vorbis? if (ident == 0x5367674f) // 'OggS' |