avcodec/avpacket: fix leak on realloc in av_packet_add_side_data()
authorJames Almer <jamrial@gmail.com>
Sat, 19 Nov 2016 15:38:44 +0000 (12:38 -0300)
committerJames Almer <jamrial@gmail.com>
Sat, 19 Nov 2016 23:24:54 +0000 (20:24 -0300)
commit3bd7ad58a7e167c114db6cbc01b8fa17f5e30ce4
tree023d10331cd2280865fe61cac884463f7ecd1a44
parentf97bee9ad565cba3b8e348167105b73211787066
avcodec/avpacket: fix leak on realloc in av_packet_add_side_data()

If realloc fails, the pointer is overwritten and the previously allocated
buffer is leaked, which goes against the expected behavior of keeping the
packet unchanged in case of error.

Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 574929d8b6de32ae712fcca7ab09f01a3e4616be)
libavcodec/avpacket.c