Image cache rewrite to using generic movie cache
[blender.git] / source / blender / editors / sculpt_paint / paint_image_proj.c
index d6989c082a101ca6575b01a050bba281d02b7872..4b402bc174140ff67a600c032dab8092451256b7 100644 (file)
@@ -542,8 +542,7 @@ static bool project_paint_PickColor(const ProjPaintState *ps, const float pt[2],
        }
 
        ima = project_paint_face_image(ps, ps->dm_mtface, face_index);
-       ibuf = ima->ibufs.first; /* we must have got the imbuf before getting here */
-       if (!ibuf) return 0;
+       ibuf = BKE_image_get_first_ibuf(ima); /* we must have got the imbuf before getting here */
 
        if (interp) {
                float x, y;
@@ -599,6 +598,7 @@ static bool project_paint_PickColor(const ProjPaintState *ps, const float pt[2],
                        }
                }
        }
+       IMB_freeImBuf(ibuf);
        return 1;
 }