2016-02-23 0:22 GMT+01:00 Ganesh Ajjanagadde <[email protected]>:

> On Fri, Feb 19, 2016 at 1:06 PM, Martin Vignali
> <[email protected]> wrote:
> > Hello,
> >
> > Is it necessary to clip value, if B == 0 ?
>
> Well, integer division by 0 is undefined...
>
> >
> >
> > Martin
> >
> > 2016-02-19 18:47 GMT+01:00 Timothy Gu <[email protected]>:
> >
> [...]
>

Yes, but in that case, zero division can't happen, because B == 0 is tested.

For now, this is the line

av_clip_uint8(B == 0 ? 255 : 255 * A / B))


I think something like this can be enough :

B == 0 ? 255 : av_clip_uint8(255 * A / B))


Martin
_______________________________________________
ffmpeg-devel mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to