Menu

Encoded data not determistic

Discussion
juf_mr
2011-06-09
2013-05-02
  • juf_mr

    juf_mr - 2011-06-09

    Hi, we're using PGF images in our project to take advantage of the gain in room and speed decoding.
    Basically we convert our png sources into pgf outputs and compute a hash on the outputs to handle versionning of assets, so that as soon as an output will be binary different, its hash will be different.

    But I noticed that even when input files were not modified, the hash of the ouput PGF can differ. After having investigated in the source code of libpgf, I found out that is was due to the 32 bits padding on uninitialized buffers meaning some undefined data is written to the output stream. I managed to fix the issue by adding a couple of memset in the code to initialize the buffers. I can provide you with the fix if you want to but I m sure there s a more optimized way to do it (like setting only the skipped bits). That's a quick fix.

    That was just to let you know. Cheers and thanks for your beautiful work !

     
  • Raphael Schweizer

    Thanks for reporting. A similar issue was reported by digiKam devs. There's a new version of libPGF on its way (probably still takes some weeks). I will make sure that this problem is fixed in the upcoming release.

    - Raphael

     

Log in to post a comment.

MongoDB Logo MongoDB