lavc: avoid invalid memcpy() in avcodec_default_release_buffer()
authorMans Rullgard <mans@mansr.com>
Mon, 5 Dec 2011 15:38:10 +0000 (15:38 +0000)
committerMans Rullgard <mans@mansr.com>
Sun, 11 Dec 2011 18:54:28 +0000 (18:54 +0000)
commita09bb3ba5e018b81a659c199a84cd1d80c07d869
treeb4408b2e54ad6358549ded48fb90b61bc9b0e187
parent3383a53e7d0abb9639c3ea3481f0eda9dca61a26
lavc: avoid invalid memcpy() in avcodec_default_release_buffer()

When the buf and last pointers are equal, the FFSWAP() results
in an invalid call to memcpy() with same source and destination
on some targets.  Although assigning a struct to itself is valid
C99, gcc does not check for this before calling memcpy().
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32667

Signed-off-by: Mans Rullgard <mans@mansr.com>
libavcodec/utils.c