imgcodecs: fix RBaseStream hang on truncated inputs
imgcodecs: fix RBaseStream hang on truncated inputs

opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv,opencv/opencv