[FFmpeg-cvslog] avcodec/proresenc_anatoliy: Mark impossible case as unreachable
Andreas Rheinhardt
git at videolan.org
Wed May 21 13:47:31 EEST 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sun Oct 3 14:24:33 2021 +0200| [b5824a6dab6c5c5877ffaf05544ed6a4b7a81c12] | committer: Andreas Rheinhardt
avcodec/proresenc_anatoliy: Mark impossible case as unreachable
Alternative fix for fix Coverity issue 1440385 (instead of
6106177ad66ab28f44520534f386239d2405eeab).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b5824a6dab6c5c5877ffaf05544ed6a4b7a81c12
---
libavcodec/proresenc_anatoliy.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
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(
More information about the ffmpeg-cvslog
mailing list