summaryrefslogtreecommitdiffstats
path: root/applypatch/imgdiff.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use static_cast to cast pointers returned by malloc/calloc/realloc/mmap.Rahul Chaudhry2016-11-161-16/+16
| | | | | | | | | | | static_cast is preferable to reinterpret_cast when casting from void* pointers returned by malloc/calloc/realloc/mmap calls. Discovered while looking at compiler warnings (b/26936282). Test: WITH_TIDY=1 WITH_STATIC_ANALYZER=1 mma Change-Id: Iaffd537784aa857108f6981fdfd82d0496eb5592 Merged-In: I151642d5a60c94f312d0611576ad0143c249ba3d
* Revert "Fix memory/resource handling in imgdiff.cpp, using unique_ptr and vector."Tao Bao2016-06-011-38/+40
| | | | | | This reverts commit 50a6f8c8335be920833d06e5dabd37de279c98a9. A mix of new and free leads to memory corruptions.
* Fix memory/resource handling in imgdiff.cpp, using unique_ptr and vector.Adam Buchbinder2016-06-011-40/+38
| | | | | | | | | | | | | | | | | | | | | This fixes the following cppcheck reports: [imgdiff.cpp:197]: (error) Memory leak: img [imgdiff.cpp:386]: (error) Memory leak: img [imgdiff.cpp:656]: (error) Memory leak: data [imgdiff.cpp:664]: (error) Memory leak: data [imgdiff.cpp:668]: (error) Memory leak: data [imgdiff.cpp:668]: (error) Resource leak: f [imgdiff.cpp:820]: (error) Memory leak: bonus_data [imgdiff.cpp:824]: (error) Memory leak: bonus_data [imgdiff.cpp:824]: (error) Resource leak: f [imgdiff.cpp:847]: (error) Memory leak: bonus_data [imgdiff.cpp:851]: (error) Memory leak: bonus_data [imgdiff.cpp:856]: (error) Memory leak: bonus_data [imgdiff.cpp:860]: (error) Memory leak: bonus_data [imgdiff.cpp:227]: (error) Memory leak: temp_entries Change-Id: I06f878d0b677a25328e0deb84f65f3b7212e24b1 (cherry picked from commit 51dc9444bcf8d8900a521795e873d07f6cd445ef)
* applypatch: Use bsdiff from external/bsdiff.Sen Jiang2016-05-041-14/+3
| | | | | | | | | | external/bsdiff uses divsufsort which is much faster, and also include some bug fixes. Bug: 26982501 Test: ./imgdiff_test.sh Change-Id: I089a301c291ee55d79938c7a3ca6d509895440d1
* imgdiff: don't fail if gzip is corrupted.Sen Jiang2016-02-121-12/+10
| | | | | | | | Treat it as a normal chunk if inflate() fails. Test: run imgdiff on corrupted gzip and apply the patch Bug: 27153028 Change-Id: Idcbb3c1360ec0774e6c7861b21d99af8ee10604a
* applypatch: Add a Makefile to build imgdiff in Chrome OS.Sen Jiang2016-02-101-2/+0
| | | | | | | | | Also fixed some warnings and added check for target_len. Test: mma; emerge-peppy imgdiff; emerge-nyan imgdiff; sudo emerge imgdiff Bug: 26866274 Change-Id: Ifbcd3afd6701c769ccf626e33ed94461706f7ee6
* imgdiff: skip spurious gzip headers in image filesDavid Riley2015-12-231-6/+13
| | | | | | | | | | | | | dragon kernel is compressed via lz4 for boot speed and bootloader support reasons and recent prebuilts happen to include the gzip header sequence which is causing imgdiff to fail. Detect a spurious gzip header and treat the section as a normal section. Bug: 26133184 Change-Id: I369d7d576fd7d2c579c0780fc5c669a5b6ea0d3d (cherry picked from commit 0f2f6a746af517afca9e5e089a4a17be0a9766d6) Signed-off-by: David Riley <davidriley@google.com>
* imgdiff: fix file descriptor leakJeremy Compostella2015-09-081-1/+9
| | | | | | | | | | mkstemp() allocates a file description that is never released. If MakePatch() is called too many time, imgdiff reaches the Operating System EMFILE (too many open files) limit. Change-Id: Icbe1399f6f6d32cfa1830f879cacf7d75bbd9fc3 Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Signed-off-by: Gaelle Nassiet <gaellex.nassiet@intel.com>
* recovery: Switch applypatch/ and updater/ to cpp.Tao Bao2015-07-141-0/+1068
Mostly trivial changes to make cpp compiler happy. Change-Id: I69bd1d96fcccf506007f6144faf37e11cfba1270