| 1082 | } |
| 1083 | |
| 1084 | static void avifDecoderDataClearTiles(avifDecoderData * data) |
| 1085 | { |
| 1086 | for (unsigned int i = 0; i < data->tiles.count; ++i) { |
| 1087 | avifTile * tile = &data->tiles.tile[i]; |
| 1088 | if (tile->input) { |
| 1089 | avifCodecDecodeInputDestroy(tile->input); |
| 1090 | tile->input = NULL; |
| 1091 | } |
| 1092 | if (tile->codec) { |
| 1093 | // Check if tile->codec was created separately and destroy it in that case. |
| 1094 | if (tile->codec != data->codec && tile->codec != data->codecAlpha) { |
| 1095 | avifCodecDestroy(tile->codec); |
| 1096 | } |
| 1097 | tile->codec = NULL; |
| 1098 | } |
| 1099 | if (tile->image) { |
| 1100 | avifImageDestroy(tile->image); |
| 1101 | tile->image = NULL; |
| 1102 | } |
| 1103 | } |
| 1104 | data->tiles.count = 0; |
| 1105 | for (int c = 0; c < AVIF_ITEM_CATEGORY_COUNT; ++c) { |
| 1106 | data->tileInfos[c].tileCount = 0; |
| 1107 | data->tileInfos[c].decodedTileCount = 0; |
| 1108 | } |
| 1109 | if (data->codec) { |
| 1110 | avifCodecDestroy(data->codec); |
| 1111 | data->codec = NULL; |
| 1112 | } |
| 1113 | if (data->codecAlpha) { |
| 1114 | avifCodecDestroy(data->codecAlpha); |
| 1115 | data->codecAlpha = NULL; |
| 1116 | } |
| 1117 | } |
| 1118 | |
| 1119 | static void avifDecoderDataDestroy(avifDecoderData * data) |
| 1120 | { |
no test coverage detected