Avoid potential dereferencing of a null pointer
Change-Id: Ia9b219e06a12e5682f29895228884d8db70232c9
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index a91c04b..addc261 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -3938,9 +3938,11 @@
get_tile_buffers(pbi, data, data_end, tile_buffers, start_tile, end_tile);
if (pbi->tile_data == NULL || n_tiles != pbi->allocated_tiles) {
- for (int i = 0; i < pbi->allocated_tiles; i++) {
- TileDataDec *const tile_data = pbi->tile_data + i;
- av1_dec_row_mt_dealloc(&tile_data->dec_row_mt_sync);
+ if (pbi->tile_data != NULL) {
+ for (int i = 0; i < pbi->allocated_tiles; i++) {
+ TileDataDec *const tile_data = pbi->tile_data + i;
+ av1_dec_row_mt_dealloc(&tile_data->dec_row_mt_sync);
+ }
}
decoder_alloc_tile_data(pbi, n_tiles);
}