Commit Graph

2 Commits

Author SHA1 Message Date
Vadym Bezdushnyi
bc04ea39a5 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>
2021-02-27 22:09:51 +01:00
erankor
4469e8ebb2 movenc: support cenc (common encryption)
support writing encrypted mp4 using aes-ctr, conforming to ISO/IEC
23001-7.

3 new parameters were added:
- encryption_scheme - allowed values are none (default) and cenc-aes-ctr
- encryption_key - 128 bit encryption key (hex)
- encryption_kid - 128 bit encryption key identifier (hex)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-15 14:16:28 +01:00