quiet some clang warnings & fix for bugs in exceptional cases.
[blender-staging.git] / source / blender / blenkernel / intern / pointcache.c
index a8c7266b3fa44cd1f4df6024d248d79f16d8d4bc..179aab064b40e486ad77513b06b8b9ea478ccd28 100644 (file)
@@ -1373,11 +1373,13 @@ static void ptcache_find_frames_around(PTCacheID *pid, unsigned int frame, int *
                while(pm->next && pm->next->frame < frame)
                        pm= pm->next;
 
-               if(pm2 && pm2->frame < frame)
+               if(pm2->frame < frame) {
                        pm2 = NULL;
+               }
                else {
-                       while(pm2->prev && pm2->prev->frame > frame)
+                       while(pm2->prev && pm2->prev->frame > frame) {
                                pm2= pm2->prev;
+                       }
                }
 
                if(pm && !pm2) {