Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<class T> static void safe_aligned_reallocz(T *&ptr, size_t old_size size_t new_size) {
- void *newalloc = av_mallocz(size);
- if (newalloc) {
- memcpy(ptr, newalloc, min(old_size, new_size));
- }
- av_free(ptr);
- ptr = static_cast<T*>(newalloc);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement