]> git.sesse.net Git - ffmpeg/commit
avformat/webpenc: Fix memleak when using invalid packets
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 18 Mar 2021 22:04:37 +0000 (23:04 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 23 Mar 2021 23:28:21 +0000 (00:28 +0100)
commitf9043de99a23e35a34c79bfbc9ef17b27f7236d1
tree55998d87f8a5ae494e777e9dddc1587be38b811b
parent484a322f0a01d50175a5819b5f5925891dd45240
avformat/webpenc: Fix memleak when using invalid packets

The WebP muxer sometimes caches a packet it receives to write it later;
yet if a cached packet is too small (so small as to be invalid),
it is cached, but not written and not unreferenced. Such a packet leaks,
either by being overwritten by the next packet or because it is never
unreferenced at all.

Fix this by not caching unusable packets at all; and error out on
invalid packets.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/webpenc.c