diff options
author | nagarajan.n <nagarajan.n@samsung.com> | 2017-07-19 19:02:25 +0530 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-07 14:30:21 +0000 |
commit | 67e3429ce0df02dbdda128c978b6ceee1655b18b (patch) | |
tree | d39096bb58f79371162e429c7d4736095406602f | |
parent | a81b62674aa0bc382b8efbc54aaae8a75b6ec6ed (diff) |
Update libjpeg buffer status when it has has to be refilled.
To fix the error "corrupt JPEG data: premature end of
data segment chromium" update the status to libjpeg
when buffer has to be refilled.
Bug: skia: None
Change-Id: I20d253133b5cf8e8e75b5f44774d0116a0a854ee
Reviewed-on: https://skia-review.googlesource.com/24600
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
-rw-r--r-- | src/codec/SkJpegUtility.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/codec/SkJpegUtility.cpp b/src/codec/SkJpegUtility.cpp index c9c8d3b11c..7bfb6bf5e6 100644 --- a/src/codec/SkJpegUtility.cpp +++ b/src/codec/SkJpegUtility.cpp @@ -40,6 +40,9 @@ static boolean sk_fill_buffered_input_buffer(j_decompress_ptr dinfo) { // libjpeg is still happy with a less than full read, as long as the result is non-zero if (bytes == 0) { + // Let libjpeg know that the buffer needs to be refilled + src->next_input_byte = nullptr; + src->bytes_in_buffer = 0; return false; } |