)]}' { "commit": "ad178855775da18d7abfadce4b64825f3e32adbd", "tree": "8709b39b40f676e25da4c08cd940c5dbb53848cd", "parents": [ "e7f4d334eff7d396ec0043a97f751483f8cc9e75" ], "author": { "name": "Ryan Harrison", "email": "rharrison@chromium.org", "time": "Thu May 03 20:40:35 2018 +0000" }, "committer": { "name": "Chromium commit bot", "email": "commit-bot@chromium.org", "time": "Thu May 03 20:40:35 2018 +0000" }, "message": "Invalidate GIF input buffer when moving file cursor backwards\n\nThe current implementation of the GIF codec does not handle the file\ncursor moving backwards correctly. Specifically the input buffer that\nthe data is being read into is not invalidated, so if the entirity of\nthe buffer hasn\u0027t been consumed, a chunk of it will be moved to the\nfront before reading in more data, which is just\nincorrect. Additionally, depending on the specific series of\noperations, it is possible that the buffer was allocated for more\nspace then had been read into it and the uninitialized portion at the\nend is being copied to the beginning.\n\nThe file cursor may move backwards when dealing with an animated gif\nor other image with multiple frames, since all of the control data is\nread in on load, and future calls specify what frame to fetch. The\ncode has been changed to treat the input buffer as invalid when moving\nthe cursor to a frame location, which will bypass any of the\nproblematic unused saving behaviour. A call to std::min has been added\nto prevent allocation of an input buffer larger then the file size.\n\nAdditionally this CL refactors GifReadMoreData to be clearer about\nwhat calculations are occuring, since the existing code reuses a\nnumber of vaguely named variables, making it difficult to follow.\n\nBUG\u003dchromium:839348, chromium:839361\n\nChange-Id: I2865658187bdf30bcad13ef4cac4f51a8966db11\nReviewed-on: https://pdfium-review.googlesource.com/32054\nReviewed-by: Henrique Nakashima \u003chnakashima@chromium.org\u003e\nCommit-Queue: Ryan Harrison \u003crharrison@chromium.org\u003e\n", "tree_diff": [ { "type": "modify", "old_id": "4a67bbb33533d2d7e3245b5fbadd13c47750430d", "old_mode": 33188, "old_path": "core/fxcodec/codec/ccodec_progressivedecoder.h", "new_id": "a14ec0db297af482924c08aeced44805e72e1840", "new_mode": 33188, "new_path": "core/fxcodec/codec/ccodec_progressivedecoder.h" }, { "type": "modify", "old_id": "9d25d3f140b19716db47a93bd703f42fe7a16256", "old_mode": 33188, "old_path": "core/fxcodec/codec/fx_codec_progress.cpp", "new_id": "e1aec2215052ed8fed1928ffbb7d7d096918e3fa", "new_mode": 33188, "new_path": "core/fxcodec/codec/fx_codec_progress.cpp" } ] }