Commit aebbbf02 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vlc_alloc: use multiplication overflow helper

Signed-off-by: Thomas Guillem's avatarThomas Guillem <thomas@gllm.fr>
parent 621449d6
......@@ -961,7 +961,7 @@ VLC_API bool vlc_ureduce( unsigned *, unsigned *, uint64_t, uint64_t, uint64_t )
VLC_USED VLC_MALLOC
static inline void *vlc_alloc(size_t count, size_t size)
{
return likely(count * size >= size) ? malloc(count * size) : NULL;
return mul_overflow(count, size, &size) ? NULL : malloc(size);
}
/*****************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment