-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix a memory leak and an off-by-one problem in curves filter. #164
Conversation
This patch fixes the MLT/Kdenlive crash on Bézier Curves.
|
@j-b-m Yes, I think you are right. I have force-pushed this change. |
@j-b-m sure, planning to re-run in address-sanitizer within this week |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I detect an heap-buffer-overflow when running without a set parameter, this is due to the initialization of c/bsplineMap buffer to a single double as placeholder on filter construct.
==12188==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000013fc0 at pc 0x7fb558a1b5cb bp 0x7ffc55c11230 sp 0x7ffc55c11228
READ of size 8 at 0x602000013fc0 thread T0
#0 0x7fb558a1b5ca in f0r_update /home/jrml/devel/frei0r/src/filter/curves/curves.c:812
#1 0x5654e913f34a in main /home/jrml/devel/frei0r/test/frei0r-test.c:148
#2 0x7fb570446189 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
#3 0x7fb570446244 in __libc_start_main_impl ../csu/libc-start.c:381
#4 0x5654e913e440 in _start (/home/jrml/devel/frei0r/test/frei0r-test+0x4440)
0x602000013fc0 is located 168 bytes to the right of 8-byte region [0x602000013f10,0x602000013f18)
The solution is to improve update with a detection of correct initialization, which happens only when a parameter is changes. Will commit my fix to this PR. |
Not sure if this resolves #156. At least it prevents a segfault in kdenlive for me.