Page MenuHome

Fix T38440: Segmentation fault in MovieClipEditor.
ClosedPublic

Authored by Alex Babahin (tamerlan311) on Feb 2 2014, 12:06 AM.

Diff Detail

Event Timeline

Sergey Sharybin (sergey) requested changes to this revision.Feb 2 2014, 3:09 PM

This is incorrect fix, you're skipping two things:

  1. real_ibuf_size()` is to be called regardless SKIP_CACHE flag is passed. This is needed to initialize clip dimensions properly.
  2. You're skipping postprocessing, meaning movieclip_get_postprocessed_ibuf() will return wrong image.

Proper solution is to split put_postprocessed_frame_to_cache() into two pieces, one of which will do post-processing, and second one which will store post-processed buffer in cache.

Alex Babahin (tamerlan311) updated this revision to Unknown Object (????).Feb 3 2014, 7:15 AM

Reworked version, depend on D282 .

source/blender/blenkernel/intern/movieclip.c
783

I would call it postprocess_frame(). You're not making it, you're post-processing it.

795

While you're on here, make it

bool disable_red   = (postprocess_flag & MOVIECLIP_DISABLE_RED) != 0

And same for all the rest of the channels. BKE_tracking_disable_channels() accepts bools, so passing ints could lead to some issues. Let's clean this up.

804

This is rather weird, all the movie clip get_ibuf functions are to return referenced image buffer. Here you skip referencing which would lead to wrong user counter in the future?

893

This could be simplified logic:

ImBuf *tmpibuf = ibuf;
ibuf = make_postprocessed_frame(clip, user, tmpibuf, postprocess_flag);
IMB_freeImBuf(tmpibuf);
if (ibuf && (cache_flag & MOVIECLIP_CACHE_SKIP) == 0) {
  put_frame_to_postprocessed_cache(...);
}

This way you'll simplify put_frame_to_postprocessed_cache() a bit further.

Sergey Sharybin (sergey) requested changes to this revision.Feb 3 2014, 8:46 AM
Alex Babahin (tamerlan311) updated this revision to Unknown Object (????).Feb 3 2014, 7:31 PM
  • update patch.