From 257fa3be54c1fb2356d64b99eb9c193270452aa5 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sat, 18 Jan 2014 20:31:47 -0800 Subject: [PATCH] fix jpeg reading regression after #1805 - closes #2123 (patch from @clundgren) --- src/jpeg_reader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jpeg_reader.cpp b/src/jpeg_reader.cpp index 0430ae861..efcf4373c 100644 --- a/src/jpeg_reader.cpp +++ b/src/jpeg_reader.cpp @@ -168,7 +168,7 @@ void jpeg_reader::skip(j_decompress_ptr cinfo, long count) } else { - wrap->stream->seekg(count, std::ios_base::cur); + wrap->stream->seekg(count - wrap->manager.bytes_in_buffer, std::ios_base::cur); // trigger buffer fill wrap->manager.next_input_byte = 0; wrap->manager.bytes_in_buffer = 0; //bytes_in_buffer may be zero on return.