code cleanup: remove paranoid NULL checks (these cases would crash earlier of the...
[blender.git] / source / blender / avi / intern / avi.c
index cda2cf303ebf1531f0ed9aaaa178ad10e761aca8..2845b2f95c9a17ae6888184b884c72284ca4728b 100644 (file)
@@ -734,16 +734,15 @@ AviError AVI_close(AviMovie *movie)
 
        fclose(movie->fp);
 
-       for (i = 0; movie->header && (i < movie->header->Streams); i++) {
-               if (movie->streams && (movie->streams[i].sf != NULL)) {
+       for (i = 0; i < movie->header->Streams; i++) {
+               if (movie->streams[i].sf != NULL) {
                        MEM_freeN(movie->streams[i].sf);
                }
        }
 
-       if (movie->header != NULL)
-               MEM_freeN(movie->header);
-       if (movie->streams != NULL)
-               MEM_freeN(movie->streams);
+       MEM_freeN(movie->header);
+       MEM_freeN(movie->streams);
+
        if (movie->entries != NULL)
                MEM_freeN(movie->entries);
        if (movie->offset_table != NULL)
@@ -1082,15 +1081,15 @@ AviError AVI_close_compress(AviMovie *movie)
 
        fclose(movie->fp);
 
-       for (i = 0; movie->header && (i < movie->header->Streams); i++) {
+       for (i = 0; i < movie->header->Streams; i++) {
                if (movie->streams && (movie->streams[i].sf != NULL)) {
                        MEM_freeN(movie->streams[i].sf);
                }
        }
-       if (movie->header != NULL)
-               MEM_freeN(movie->header);
-       if (movie->entries != NULL)
-               MEM_freeN(movie->entries);
+
+       MEM_freeN(movie->header);
+       MEM_freeN(movie->entries);
+
        if (movie->streams != NULL)
                MEM_freeN(movie->streams);
        if (movie->offset_table != NULL)