libavformat/flacenc: reject too big picture blocks
authorMattias Wadman <mattias.wadman@gmail.com>
Wed, 30 Oct 2019 13:01:28 +0000 (14:01 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 1 Nov 2019 13:43:16 +0000 (14:43 +0100)
commite447a4d112bcfee10126c54eb4481fa8712957c8
tree1b148dfa68dee6744410c23d4b7c5f102d15fcad
parentbb718d11ed992f4d12ad683e310b53bf1c519322
libavformat/flacenc: reject too big picture blocks

A too big picture will case the muxer to write a truncated block size (uint24)
causing the output file to be corrupt.

How to reproduce:

Write a file with truncated block size:
ffmpeg -y -f lavfi -i sine -f lavfi -i color=red:size=2400x2400 -map 0:a:0 -map 1:v:0 -c:v:0 bmp -disposition:1 attached_pic -t 1 test.flac

Try to decode:
ffmpeg -i test.flac test.wav

Signed-off-by: Mattias Wadman <mattias.wadman@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/flacenc.c