Signed-off-by: Alex Henrie alex.henrie@utah.edu --- Passing NULL to memcpy causes a segfault in newer versions of GCC, see https://www.imperialviolet.org/2016/06/26/nonnull.html --- dlls/quartz/filtermapper.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/quartz/filtermapper.c b/dlls/quartz/filtermapper.c index 0d26198637..7a5b5aee72 100644 --- a/dlls/quartz/filtermapper.c +++ b/dlls/quartz/filtermapper.c @@ -148,8 +148,11 @@ static int add_data(struct Vector * v, const BYTE * pData, int size) LPBYTE pOldData = v->pData; v->capacity = (v->capacity + size) * 2; v->pData = CoTaskMemAlloc(v->capacity); - memcpy(v->pData, pOldData, v->current); - CoTaskMemFree(pOldData); + if (pOldData) + { + memcpy(v->pData, pOldData, v->current); + CoTaskMemFree(pOldData); + } } memcpy(v->pData + v->current, pData, size); v->current += size;