diff options
author | Anton Khirnov <anton@khirnov.net> | 2022-01-20 16:56:53 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-04-13 12:48:19 +0200 |
commit | e663030267851e0e0be54dc9d685fa9cd883cef6 (patch) | |
tree | 7a298e75ea2ae3c938525781e27369d32b3bdfdf /libavcodec/encode.c | |
parent | ee26138e67fb01a0d95966ee7d143e7361057fb0 (diff) | |
download | ffmpeg-e663030267851e0e0be54dc9d685fa9cd883cef6.tar.gz |
lavc/encode: pick a sane default for bits_per_raw_sample if it's not set
Fixes #9563.
Diffstat (limited to 'libavcodec/encode.c')
-rw-r--r-- | libavcodec/encode.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/encode.c b/libavcodec/encode.c index 85b8e089dd..6ae47b736c 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c @@ -555,6 +555,9 @@ FF_DISABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS #endif + if (!avctx->bits_per_raw_sample) + avctx->bits_per_raw_sample = 8 * av_get_bytes_per_sample(avctx->sample_fmt); + return 0; } |