lavc/encode: pick a sane default for bits_per_raw_sample if it's not set

Fixes #9563.
This commit is contained in:
Anton Khirnov 2022-01-20 16:56:53 +01:00
parent ee26138e67
commit e663030267
1 changed files with 3 additions and 0 deletions

View File

@ -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;
}