diff options
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( |