This very short patch fixes nrv2b compression in lar.
It also fixes lzma compression in lar to fix the silent memory corruption that was possible when files didn't compress well.
It adds some comments to both files and the file that calls them.
Myles
Signed-off-by: Myles Watson mylesgw@gmail.com
Myles Watson wrote:
This very short patch fixes nrv2b compression in lar.
It also fixes lzma compression in lar to fix the silent memory corruption that was possible when files didn't compress well.
It adds some comments to both files and the file that calls them.
Myles
Signed-off-by: Myles Watson mylesgw@gmail.com
Acked-by: Stefan Reinauer stepan@coresystems.de
- std::memcpy(out, &result[0], *out_len);
- if (*out_len < in_len)
std::memcpy(out, &result[0], *out_len);
I think this one should even be memcpy instead of std:memcpy.. I had some versions of gcc complain that memcpy is not in the std scope.
Not really part of this patch, but I saw later down you use memcpy without std:: anyways.
Stefan
Myles Watson wrote:
This very short patch fixes nrv2b compression in lar.
It also fixes lzma compression in lar to fix the silent memory corruption that was possible when files didn't compress well.
It adds some comments to both files and the file that calls them.
Myles
Signed-off-by: Myles Watson mylesgw@gmail.com
Acked-by: Stefan Reinauer stepan@coresystems.de
Rev 658.
Thanks,
Myles
- std::memcpy(out, &result[0], *out_len);
- if (*out_len < in_len)
std::memcpy(out, &result[0], *out_len);
I think this one should even be memcpy instead of std:memcpy.. I had some versions of gcc complain that memcpy is not in the std scope.
Either one works for me. There are four of them in this file, and we could change it. A Google search suggested that some versions of gcc have problems when std is not there, but they seemed to be fairly old.
Not really part of this patch, but I saw later down you use memcpy without std:: anyways.
The difference is that one file was a C++ file and the other was C. I just used the same memcpy that was already in each file.
It's a trivial patch. I'll generate it if you'd like.
Myles