@@ -845,18 +845,25 @@ static av_cold int prores_encode_init(AVCodecContext *avctx)
}
if (avctx->profile == AV_PROFILE_UNKNOWN) {
- if (avctx->pix_fmt == AV_PIX_FMT_YUV422P10) {
+ switch (avctx->pix_fmt) {
+ case AV_PIX_FMT_YUV422P10:
avctx->profile = AV_PROFILE_PRORES_STANDARD;
av_log(avctx, AV_LOG_INFO,
"encoding with ProRes standard (apcn) profile\n");
- } else if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) {
+ break;
+ case AV_PIX_FMT_YUV444P10:
avctx->profile = AV_PROFILE_PRORES_4444;
av_log(avctx, AV_LOG_INFO,
"encoding with ProRes 4444 (ap4h) profile\n");
- } else if (avctx->pix_fmt == AV_PIX_FMT_YUVA444P10) {
+ break;
+ case AV_PIX_FMT_YUVA444P10:
avctx->profile = AV_PROFILE_PRORES_4444;
av_log(avctx, AV_LOG_INFO,
"encoding with ProRes 4444+ (ap4h) profile\n");
+ break;
+ default:
+ /* Already checked via AVCodec.pix_fmts. */
+ av_unreachable;
}
} else if (avctx->profile < AV_PROFILE_PRORES_PROXY
|| avctx->profile > AV_PROFILE_PRORES_XQ) {
Should fix Coverity issue 1440385. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- Alternative to https://ffmpeg.org/pipermail/ffmpeg-devel/2024-May/327293.html libavcodec/proresenc_anatoliy.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)