OSDN Git Service

avpacket: fix leak on realloc in av_packet_add_side_data()
authorJames Almer <jamrial@gmail.com>
Sat, 19 Nov 2016 18:33:58 +0000 (15:33 -0300)
committerAnton Khirnov <anton@khirnov.net>
Wed, 23 Nov 2016 12:17:52 +0000 (13:17 +0100)
commitaa498c3183236a93206b4a0e8225b9db0660b50d
treebf668357a29a421f220738cab79f4d2560bcd5de
parentc7ab0eb3050acdd3b8cab2c55fc9c1b2e8610a65
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 functionality of keeping the packet
unchanged in case of error.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/avpacket.c