]> git.sesse.net Git - ffmpeg/commit
avcodec/encode: Fix check for allowed LJPEG pixel formats
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Mon, 5 Apr 2021 22:32:39 +0000 (00:32 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Thu, 8 Apr 2021 09:08:10 +0000 (11:08 +0200)
commit6e8e9b7633d8b755e7a464a10ba5047f31cbd84d
tree6920712fcc70c050ef2ee849d7dc0b90e553e1a9
parent4666ce0aef395fc7dfa2a718e8d238e58e635d2a
avcodec/encode: Fix check for allowed LJPEG pixel formats

The pix_fmts of the LJPEG encoder already contain all supported pixel
formats (including the ones only supported when strictness is unofficial
or less); yet the check in ff_encode_preinit() ignored this list in case
strictness is unofficial or less. But the encoder presumed that it is
always applied and blacklists some of the entries in pix_fmts when
strictness is > unofficial. The result is that if one uses an entry not
on that list and sets strictness to unofficial, said entry passes both
checks and this can lead to segfaults lateron (e.g. when using gray).

Fix this by removing the exception for LJPEG in ff_encode_preinit().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
libavcodec/encode.c