浏览代码

Merge branch 'for-upstream-stbvorbis-fix-memleaks' of https://github.com/manxorist/stb

Sean Barrett 9 年之前
父节点
当前提交
8f368799e1
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      stb_vorbis.c

+ 6 - 0
stb_vorbis.c

@@ -2246,6 +2246,11 @@ static void decode_residue(vorb *f, float *residue_buffers[], int ch, int n, int
    }
    }
   done:
   done:
    CHECK(f);
    CHECK(f);
+   #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE
+   temp_free(f,part_classdata);
+   #else
+   temp_free(f,classifications);
+   #endif
    temp_alloc_restore(f,temp_alloc_point);
    temp_alloc_restore(f,temp_alloc_point);
 }
 }
 
 
@@ -2891,6 +2896,7 @@ static void inverse_mdct(float *buffer, int n, vorb *f, int blocktype)
       }
       }
    }
    }
 
 
+   temp_free(f,buf2);
    temp_alloc_restore(f,save_point);
    temp_alloc_restore(f,save_point);
 }
 }