Skip to content

Commit

Permalink
vcomp/lavc: do not assert on wrong bitrate
Browse files Browse the repository at this point in the history
rather return (the error message is already printed by unit_evaluate)
  • Loading branch information
MartinPulec committed Jul 10, 2024
1 parent 208c2f2 commit c9930dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/video_compress/libavcodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit c9930dc

Please sign in to comment.