diff options
author | wm4 <wm4@nowhere> | 2013-10-16 21:39:51 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-10-20 14:10:49 +0200 |
commit | 6f139ad9816a6d8c6715eb26084da7b56ba0047a (patch) | |
tree | 4c3788c068dbe502d150177e644e5bf12688add7 /video | |
parent | 0052445e86fab43779c78d085084f8842c4d3f6e (diff) | |
download | mpv-6f139ad9816a6d8c6715eb26084da7b56ba0047a.tar.bz2 mpv-6f139ad9816a6d8c6715eb26084da7b56ba0047a.tar.xz |
sws_utils: work around libswscale crash with --contrast=-100
Diffstat (limited to 'video')
-rw-r--r-- | video/sws_utils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/video/sws_utils.c b/video/sws_utils.c index c90efe020c..c6696ec37b 100644 --- a/video/sws_utils.c +++ b/video/sws_utils.c @@ -24,6 +24,7 @@ #include "sws_utils.h" +#include "mpvcore/mp_common.h" #include "video/mp_image.h" #include "video/img_format.h" #include "fmt-conversion.h" @@ -327,7 +328,7 @@ int mp_sws_set_vf_equalizer(struct mp_sws_context *sws, struct vf_seteq *eq) if (!strcmp(eq->item, "brightness")) sws->brightness = ((eq->value << 16) + 50) / 100; else if (!strcmp(eq->item, "contrast")) - sws->contrast = (((eq->value + 100) << 16) + 50) / 100; + sws->contrast = MPMAX(1, (((eq->value + 100) << 16) + 50) / 100); else if (!strcmp(eq->item, "saturation")) sws->saturation = (((eq->value + 100) << 16) + 50) / 100; else |