Itseez/opencv — pull request #1844 by StevenPuttemans (2013-11-21 13:09:45+00:00)
Title: Applied fix mentioned in bugreport 3370. Seems to solve the issue.

Small bug in the nextImg() function leading to a endless loop once a negative image is supplied, smaller than the actual window size. More info at: code.opencv.org/issues/3370