]> git.sesse.net Git - ffmpeg/commit
avformat/movenccenc: Fix memory leak for muxing CENC-encrypted files
authorVadym Bezdushnyi <vadim.bezdush@gmail.com>
Sun, 31 Jan 2021 14:52:45 +0000 (16:52 +0200)
committerMarton Balint <cus@passwd.hu>
Sat, 27 Feb 2021 21:09:51 +0000 (22:09 +0100)
commitbc04ea39a57a22dd4d26946a83e166f090218054
treea87f1fc5a2ad981f7e3ebee25d5d23fc2f3c6730
parent2d32aed85c4874a2596202b6f0c08e6ce49e3bca
avformat/movenccenc: Fix memory leak for muxing CENC-encrypted files

Memory for auxillary_info was not freed after usage.

Leak can be reproduced with following commands:

Optionally, generate input video:
ffmpeg -f lavfi -i testsrc=duration=10:size=1280x720:rate=30 input.mp4

Run ffmpeg with valgrind:
valgrind --leak-check=full --show-leak-kinds=all \
ffmpeg -y -i input.mp4 -vcodec copy -acodec copy \
-encryption_scheme cenc-aes-ctr \
-encryption_key 00000000000000000000000000000000 \
-encryption_kid 00000000000000000000000000000000 \
ffmpeg_encrypted.mp4

For test video which has duration of 10 sec, leak is 4 Kb.
For 100 sec video, leak will be 33 Kb. Most likely,
leaked memory will grow linearly to the number of input frames.

Signed-off-by: Vadym Bezdushnyi <vadim.bezdush@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
libavformat/movenccenc.c