Two bugfixes for Image commit:
authorTon Roosendaal <ton@blender.org>
Wed, 20 Dec 2006 19:23:57 +0000 (19:23 +0000)
committerTon Roosendaal <ton@blender.org>
Wed, 20 Dec 2006 19:23:57 +0000 (19:23 +0000)
- Jkey press without a render crashed
- UV FaceSelect, assign/view image,  crashed all over... :)

source/blender/src/header_image.c
source/blender/src/renderwin.c

index d1bfcdbe125b5bfab38c6a97e9fafa85dcf7fbd9..e283930721206fd2e252c19009be062ce71181d5 100644 (file)
@@ -1067,8 +1067,8 @@ static uiBlock *image_uvsmenu(void *arg_unused)
 
 void image_buttons(void)
 {
-       Image *ima= G.sima->image;
-       ImBuf *ibuf= BKE_image_get_ibuf(ima, &G.sima->iuser);
+       Image *ima;
+       ImBuf *ibuf;
        uiBlock *block;
        short xco, xmax;
        char naam[256], *menuname;
@@ -1084,6 +1084,8 @@ void image_buttons(void)
        else uiBlockSetCol(block, TH_HEADERDESEL);
 
        what_image(G.sima);
+       ima= G.sima->image;
+       ibuf= BKE_image_get_ibuf(ima, &G.sima->iuser);
 
        curarea->butspacetype= SPACE_IMAGE;
 
@@ -1187,7 +1189,7 @@ void image_buttons(void)
                        uiDefIconBut(block, BUT, B_SIMA_RECORD, ICON_REC,  xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Record Composite");
                        xco+= XIC;
                }
-               if((ima->type==IMA_TYPE_COMPOSITE) || ELEM(G.sima->image->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
+               if((ima->type==IMA_TYPE_COMPOSITE) || ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
                        uiDefIconBut(block, BUT, B_SIMA_PLAY, ICON_PLAY, xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Play");
                        xco+= XIC;
                }
index bba8a9ebb45ec7860f41fc143d9d15728fa2a658..2750f32e1950e183c12397f3ad99448346709221 100644 (file)
@@ -1348,7 +1348,7 @@ void BIF_swap_render_rects(void)
        if(G.displaymode!=R_DISPLAYWIN) {
                imagewindow_swap_render_rects();
        }
-       else {
+       else if(render_win) {
                
                render_win->storespare= 1;
                render_win->showspare ^= 1;