Fixed crash when trying to perform transformation in Clip Editor without clip opened

Reported by JumboCoDeC in IRC. Thanks for the report.
This commit is contained in:
Sergey Sharybin 2012-06-25 19:48:05 +00:00
parent 4da7b7089d
commit 01dea9ff85
2 changed files with 11 additions and 1 deletions

@ -177,6 +177,13 @@ void ED_space_clip_get_aspect_dimension_aware(SpaceClip *sc, float *aspx, float
* mainly this is sued for transformation stuff * mainly this is sued for transformation stuff
*/ */
if (!sc->clip) {
*aspx = 1.0f;
*aspy = 1.0f;
return;
}
ED_space_clip_get_aspect(sc, aspx, aspy); ED_space_clip_get_aspect(sc, aspx, aspy);
BKE_movieclip_get_size(sc->clip, &sc->user, &w, &h); BKE_movieclip_get_size(sc->clip, &sc->user, &w, &h);

@ -5913,9 +5913,12 @@ static void createTransTrackingData(bContext *C, TransInfo *t)
t->total = 0; t->total = 0;
if (!clip)
return;
BKE_movieclip_get_size(clip, &sc->user, &width, &height); BKE_movieclip_get_size(clip, &sc->user, &width, &height);
if (!clip || width == 0 || height == 0) if (width == 0 || height == 0)
return; return;
if (ar->regiontype == RGN_TYPE_PREVIEW) { if (ar->regiontype == RGN_TYPE_PREVIEW) {