From c9930dcc85e097f12eebf39c2f308fb8fc59efab Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 10 Jul 2024 13:42:54 +0200 Subject: [PATCH] vcomp/lavc: do not assert on wrong bitrate rather return (the error message is already printed by unit_evaluate) --- src/video_compress/libavcodec.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/video_compress/libavcodec.cpp b/src/video_compress/libavcodec.cpp index 5c5f8aad8..c5322a0d2 100644 --- a/src/video_compress/libavcodec.cpp +++ b/src/video_compress/libavcodec.cpp @@ -536,7 +536,9 @@ parse_fmt(struct state_video_compress_libav *s, char *fmt) noexcept(false) } else if (IS_KEY_PREFIX(item, "bitrate")) { s->params.requested_bitrate = unit_evaluate(strchr(item, '=') + 1, nullptr); - assert(s->params.requested_bitrate >= 0); + if (s->params.requested_bitrate < 0) { + return -1; + } } else if(strncasecmp("bpp=", item, strlen("bpp=")) == 0) { char *bpp_str = item + strlen("bpp="); s->params.requested_bpp =