write_features_to_file: check fopen() result This is a follow up to: dadc6023d ExternalPartitionTestDfsAPI: skip check w/WRITE_FEATURE_TO_FILE=0 Return if the file open fails to avoid a crash. In the case of WRITE_FEATURE_TO_FILE=0 the test will pass as expected. With WRITE_FEATURE_TO_FILE=1 this would cause test failure as the comparison will be performed which is also expected. Bug: b/191266788 Change-Id: I7fa52b5599533843f6d17c22970583e664a217be
diff --git a/av1/encoder/partition_strategy.c b/av1/encoder/partition_strategy.c index 269bbfd..91d1a74 100644 --- a/av1/encoder/partition_strategy.c +++ b/av1/encoder/partition_strategy.c
@@ -115,6 +115,7 @@ snprintf(filename, sizeof(filename), "%s/%s", path, get_feature_file_name(id)); FILE *pfile = fopen(filename, "a"); + if (pfile == NULL) return; if (!is_test_mode) { fprintf(pfile, "%d,%d,%d,%d,%d\n", id, bsize, mi_row, mi_col, feature_size); }