[FFmpeg-devel] [PATCH] fix libswscale crash with contrast 0

Reimar Döffinger Reimar.Doeffinger
Sun Jan 31 15:52:44 CET 2010


On Sun, Jan 31, 2010 at 01:29:50AM +0100, Michael Niedermayer wrote:
> On Sun, Jan 31, 2010 at 12:57:08AM +0100, Reimar D?ffinger wrote:
> > Hello,
> > with contrast 0 (or only if lower?) there is a division by 0
> > Here's a quick hack, no idea if it's correct, but I suspect
> > it might be more correct even ignoring the crash.
> 
> the correct thing is likely what sws_setColorspaceDetails() does

Which would be? Not doing the division at all?
Also is there some kind of standard how all those controls are
supposed to work together?
E.g. is 0 contrast supposed to give a black image regardless of
brightness?
Why does contrast also apply to saturation?
I am asking because I implemented these things also for -vo gl in
MPlayer, but differently and neither IMO is really behaving "as
expected" I think, though at least the -vo gl one is more flexible
(e.g. allowing to get an image with colours but constant brightness
which seems impossible with swscale brightness/contrast/saturation only).



More information about the ffmpeg-devel mailing list