diff options
author | Marco Nelissen <marcone@google.com> | 2015-07-29 16:15:55 -0700 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2015-10-18 19:57:28 +0200 |
commit | 3b2a9b59d9bd3036a8dcc6ac34d033714054f1e7 (patch) | |
tree | 3ab77d6dba90981d366b8f96451d0c66bc6f85bc /media | |
parent | ee7eef0a2de22470127dba659b34bbb6b318dcd2 (diff) | |
download | frameworks_av-3b2a9b59d9bd3036a8dcc6ac34d033714054f1e7.zip frameworks_av-3b2a9b59d9bd3036a8dcc6ac34d033714054f1e7.tar.gz frameworks_av-3b2a9b59d9bd3036a8dcc6ac34d033714054f1e7.tar.bz2 |
Guard against codecinfo overflow
Bug: 21296336
Change-Id: I78be5141b3108142f12d7cb94839fa50f776d84a
Conflicts:
media/libstagefright/matroska/MatroskaExtractor.cpp
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/MetaData.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/media/libstagefright/MetaData.cpp b/media/libstagefright/MetaData.cpp index a01ec97..642d15a 100644 --- a/media/libstagefright/MetaData.cpp +++ b/media/libstagefright/MetaData.cpp @@ -258,7 +258,12 @@ void MetaData::typed_data::setData( mType = type; allocateStorage(size); - memcpy(storage(), data, size); + void *dst = storage(); + if (!dst) { + ALOGE("Couldn't allocate %zu bytes for item", size); + return; + } + memcpy(dst, data, size); } void MetaData::typed_data::getData( |