1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/mjpegenc_common: Use av_unreachable() instead of av_assert0(0)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-05-06 17:06:15 +02:00
parent 85fb3453f8
commit 5653e0b1fa

View File

@ -304,7 +304,8 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
switch (avctx->codec_id) { switch (avctx->codec_id) {
case AV_CODEC_ID_MJPEG: put_marker(pb, SOF0 ); break; case AV_CODEC_ID_MJPEG: put_marker(pb, SOF0 ); break;
case AV_CODEC_ID_LJPEG: put_marker(pb, SOF3 ); break; case AV_CODEC_ID_LJPEG: put_marker(pb, SOF3 ); break;
default: av_assert0(0); default: av_unreachable("ff_mjpeg_encode_picture_header only called by "
"AMV, LJPEG, MJPEG and the former has been ruled out");
} }
put_bits(pb, 16, 8 + 3 * components); put_bits(pb, 16, 8 + 3 * components);
@ -375,7 +376,7 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
switch (avctx->codec_id) { switch (avctx->codec_id) {
case AV_CODEC_ID_MJPEG: put_bits(pb, 8, 63); break; /* Se (not used) */ case AV_CODEC_ID_MJPEG: put_bits(pb, 8, 63); break; /* Se (not used) */
case AV_CODEC_ID_LJPEG: put_bits(pb, 8, 0); break; /* not used */ case AV_CODEC_ID_LJPEG: put_bits(pb, 8, 0); break; /* not used */
default: av_assert0(0); default: av_unreachable("Only LJPEG, MJPEG possible here");
} }
put_bits(pb, 8, 0); /* Ah/Al (not used) */ put_bits(pb, 8, 0); /* Ah/Al (not used) */