On Wed, 17 Jun 2009, Guennadi Liakhovetski wrote: > On Tue, 16 Jun 2009, Trent Piepho wrote: > > /* up the smaller alignment until we have enough */ > do { > - if (walign <= halign && walign < wmaxa) { > + if (halign >= hmaxa || > + (walign <= halign && walign < wmaxa)) { > > Do I understand it right now, that as soon as your halign now reaches > hmaxa, you'll stop incrementing halign and then keep incrementing walign > even beyond wmaxa?... Yes. It's clearly documented that the function isn't designed to handle impossible constraints. If both walign and halign are at max and there still needs to be more alignment then there is no possible resolution, no matter what width & height started at. This is just one of many ways the constraints could be impossible. Max width being less than min width is another obvious example. I decided it wasn't worth complicating the code to check for all of these things. And if the function did return failure the callers would need to check that. None of the code v4l_bound_align_image() replaces has a failure path for impossible image size constraints, because the constraints aren't impossible. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html