Fixed crashes when motion tracks are zero-sized

This is probably versioning issue happened when both trunk and tomato
were mixed to work on the same file.

Anyway, there're few files here locally and it's probably other users
do have the same files, so lets keep things safe here :)
This commit is contained in:
2012-11-07 11:18:42 +00:00
parent 552c0e74f4
commit 1c450d71ef
5 changed files with 68 additions and 41 deletions

View File

@@ -1597,17 +1597,15 @@ void ui_draw_but_TRACKPREVIEW(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wc
&scopes->undist_marker, scopes->use_track_mask,
width, height, scopes->track_pos);
if (tmpibuf->rect_float)
IMB_rect_from_float(tmpibuf);
if (tmpibuf) {
if (tmpibuf->rect_float)
IMB_rect_from_float(tmpibuf);
/* XXX: for debug only
* tmpibuf->ftype = PNG;
* IMB_saveiff(tmpibuf, "sample.png", IB_rect); */
if (tmpibuf->rect)
scopes->track_preview = tmpibuf;
else
IMB_freeImBuf(tmpibuf);
if (tmpibuf->rect)
scopes->track_preview = tmpibuf;
else
IMB_freeImBuf(tmpibuf);
}
}
if (!ok && scopes->track_preview) {