diff options
author | Tuomas Virtanen <katajakasa@gmail.com> | 2018-06-23 01:29:48 +0300 |
---|---|---|
committer | Tuomas Virtanen <katajakasa@gmail.com> | 2018-06-23 01:29:48 +0300 |
commit | cd1adb20d37af17195b8d4dc1f9ac761bf2f4c48 (patch) | |
tree | b407783a139877f8bf388c6ba17639a8029106ea | |
parent | 9522c7747913d3ebb54e9eeebcc5c92c6f44ebce (diff) |
Add some comments and documentation
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | src/internal/subtitle/kitatlas.c | 2 |
2 files changed, 12 insertions, 0 deletions
@@ -84,6 +84,16 @@ Make sure CUnit is installed, then add ```-DBUILD_UNITTESTS=1``` to the cmake ar You can run unittests by running ```make unittest```. +### 2.5. Building with AddressSanitizer + +This is for development/debugging use only! + +Make sure llvm is installed, then add ```-DUSE_ASAN=1``` to the cmake arguments and rebuild. Note that ASAN is not +supported on all OSes (eg. windows). + +After building, you can run with the following (make sure to set correct llvm-symbolizer path): +```ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer ./examplevideo <my videofile>``` + ## 3. License MIT. Please see ```LICENSE``` for details. diff --git a/src/internal/subtitle/kitatlas.c b/src/internal/subtitle/kitatlas.c index a97dd1d..a011989 100644 --- a/src/internal/subtitle/kitatlas.c +++ b/src/internal/subtitle/kitatlas.c @@ -25,11 +25,13 @@ Kit_TextureAtlas* Kit_CreateAtlas(int w, int h) { atlas->w = w;
atlas->h = h;
+ // Allocate items. These hold the surfaces that should be in atlas
atlas->items = calloc(atlas->max_items, sizeof(Kit_TextureAtlasItem));
if(atlas->items == NULL) {
goto exit_1;
}
+ // Allocate shelves. These describe the used space of the atlas
atlas->shelves = calloc(atlas->max_shelves, sizeof(Kit_Shelf));
if(atlas->shelves == NULL) {
goto exit_2;
|