Open bakape opened 4 years ago
I "fixed" it by setting thumbnailer.c#93 to dst->data = malloc(dst->size + 25);
so av_image_get_buffer_size
must be giving the wrong size for some files. I don't know where to go from here.
Why 25?
It's the smallest value that worked with the test data. I tried with 100 first.
I tried some imports running Hydron with Valgrind to see what's happening with memory. Running valgrind --read-var-info=yes --leak-check=no ./hydron import path
shows invalid writes when importing the files that cause crashes. Pic related. Other files report no invalid writes.
Valgrind still reports an invalid write when using the malloc(dst->size + 25)
I mentioned earlier, but malloc(dst->size + 64)
is fine.
All the bad images I've found have been jpgs with YUVJ420p colour encoding. Re-encoding them as png, or as jpg with YUVJ444p colour makes them thumbnail with no invalid writes, but not all YUVJ420p jpgs cause invalid writes.
I tried having a look at the ffmpeg source to see where the 8 bytes are coming from but I can't figure it out. Do you have any suggestions?
I believe this may be an issue with webp, as well. example_image.tar.gz wtf.log
I'll get to this eventually. Too much on my plate at the moment.
On Thu, 17 Dec 2020 at 05:22, チルノ notifications@github.com wrote:
I believe this may be an issue with webp, as well. example_image.tar.gz https://github.com/bakape/hydron/files/5706768/example_image.tar.gz wtf.log https://github.com/bakape/hydron/files/5706769/wtf.log
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bakape/hydron/issues/77#issuecomment-747179400, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB347MBSYXGVPLUPAKUTXCDSVF2QRANCNFSM4QK32OTA .
I might have fixed it in the commit above. As you can reproduce, could you try the fix? Will try to reproduce before and after commit myself a later this week.
Still aborts. When trying to reproduce, running valgrind --read-var-info=yes --leak-check=no ./hydron import path
and looking for invalid writes is more reliable than looking for crashes, by the way.
test data.zip