summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-10-16 21:39:51 +0200
committerwm4 <wm4@nowhere>2013-10-16 21:39:51 +0200
commit1eda9554d44f167f211208b4b2e4dfeb757dd657 (patch)
tree4c7b9c11101f784f75bc69441b53e619a776c81f /video
parent20e1c5f7d9928de6fae4245508e1e665a3d455cd (diff)
downloadmpv-1eda9554d44f167f211208b4b2e4dfeb757dd657.tar.bz2
mpv-1eda9554d44f167f211208b4b2e4dfeb757dd657.tar.xz
sws_utils: work around libswscale crash with --contrast=-100
Diffstat (limited to 'video')
-rw-r--r--video/sws_utils.c3
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