Bug 428794

Summary: fatal error on pixelize effect when the block size becomes negative due to smooth interpolation
Product: [Applications] kdenlive Reporter: Pierre Nerzic <pierre.nerzic>
Component: Video Effects & TransitionsAssignee: Vincent PINON <vpinon>
Status: RESOLVED UPSTREAM    
Severity: crash CC: fritzibaby, snd.noise
Priority: NOR Flags: fritzibaby: Brainstorm+
Version First Reported In: 20.08.2   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: crash log

Description Pierre Nerzic 2020-11-07 17:37:29 UTC
SUMMARY

I start with adding a "Pixelize" effect to a clip. Then I add 4 control points to drive the blocksizes X and Y. The problem appears with at least 4 points, not with 3. I put 64 as block sizes for the first and the last, and zero to both middle points. Then I choose Smooth interpolation for all. Kdenlive exits immediately when playing the clip around the second point.

I think there is lacking some clamping of the blocksize in the effect. Due to the smooth interpolation, the block size surely becomes negative, and the pixelize effect throws an exception.

I would check the Pixelize effect source code, and add something to clamp any negative block size value to zero, or clamp the value between the min and max of the interface. Maybe the same problem could affect other effects? (I hope no)

STEPS TO REPRODUCE
1. Add "Pixelize" effect to a clip
2. Add 4 control points, all with smooth interpolation, the two outer will have 64 as block sizes, and the two inner point have zero as block sizes.
3. Play the clip.

OBSERVED RESULT

Kdenlive quits abruptly when it is the time of the second point, after having correctly played the effect with decreasing block sizes.


EXPECTED RESULT

Kdenlive should play the whole clip without exiting, and cope with any accidental negative block size due to smooth interpolation.
 

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION

To go around the problem, I added other control points with linear interpolation. So it is not severe. Many thanks for your work (I say this for every bug I report, but I think it every minute I use Kdenlive).
Comment 1 emohr 2020-11-15 16:15:12 UTC
Following your steps and play the clip from the beginning I get a crash before the playhead reach the 2nd keyframe with 0/0 block. The crash happens only if this (2nd) keyframe is set to smooth. If this (2nd) keyframe is not set the smooth no crash happens.
Comment 2 farid 2021-03-23 12:10:48 UTC
Created attachment 136980 [details]
crash log

Managed to reproduce crash log.
Comment 3 farid 2021-03-25 12:23:12 UTC
Thanks for your report this is an upstream issue and has been reported, you can follow up here: https://github.com/mltframework/mlt/issues/689
Comment 4 Pierre Nerzic 2021-03-25 12:50:15 UTC
Thanks a lot. I agree, this is related to MLT.
Have a nice day!