diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index fc69b94780..4fc40abaac 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -27,6 +27,7 @@ * Known FOURCCs: 'ap4h' (444), 'apch' (HQ), 'apcn' (422), 'apcs' (LT), 'acpo' (Proxy) */ +#include "libavutil/avassert.h" #include "libavutil/mem.h" #include "libavutil/mem_internal.h" #include "libavutil/opt.h" @@ -845,20 +846,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"); - } else - av_assert0(0); + break; + default: + av_unreachable("Already checked via CODEC_PIXFMTS"); + } } else if (avctx->profile < AV_PROFILE_PRORES_PROXY || avctx->profile > AV_PROFILE_PRORES_XQ) { av_log(