[FFmpeg-cvslog] avcodec/mjpegenc_common: Use av_unreachable() instead of av_assert0(0)

Andreas Rheinhardt git at videolan.org
Wed May 21 13:48:05 EEST 2025


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue May  6 17:06:15 2025 +0200| [5653e0b1fa20d1193042f437639766eab0b79569] | committer: Andreas Rheinhardt

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

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5653e0b1fa20d1193042f437639766eab0b79569
---

 libavcodec/mjpegenc_common.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mjpegenc_common.c b/libavcodec/mjpegenc_common.c
index e7a4f8f16a..21b3b19b93 100644
--- a/libavcodec/mjpegenc_common.c
+++ b/libavcodec/mjpegenc_common.c
@@ -304,7 +304,8 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
     switch (avctx->codec_id) {
     case AV_CODEC_ID_MJPEG:  put_marker(pb, SOF0 ); 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);
@@ -375,7 +376,7 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
     switch (avctx->codec_id) {
     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 */
-    default: av_assert0(0);
+    default: av_unreachable("Only LJPEG, MJPEG possible here");
     }
 
     put_bits(pb, 8, 0); /* Ah/Al (not used) */



More information about the ffmpeg-cvslog mailing list