Merge "m4v_h263_enc_test: Fix leaks in error cases" am: bd88535d65 am: dfe305a92b
am: 4ccd50fc80
Change-Id: Id618ea723198c1bdcee6f1872d6b8a88ec544896
diff --git a/media/libstagefright/codecs/m4v_h263/enc/test/m4v_h263_enc_test.cpp b/media/libstagefright/codecs/m4v_h263/enc/test/m4v_h263_enc_test.cpp
index db2c61a..5554ebd 100644
--- a/media/libstagefright/codecs/m4v_h263/enc/test/m4v_h263_enc_test.cpp
+++ b/media/libstagefright/codecs/m4v_h263/enc/test/m4v_h263_enc_test.cpp
@@ -183,6 +183,10 @@
// Initialize the encoder.
if (!PVInitVideoEncoder(&handle, &encParams)) {
fprintf(stderr, "Failed to initialize the encoder\n");
+ fclose(fpInput);
+ fclose(fpOutput);
+ free(inputBuf);
+ free(outputBuf);
return EXIT_FAILURE;
}
@@ -190,6 +194,10 @@
int32_t headerLength = kOutputBufferSize;
if (!PVGetVolHeader(&handle, outputBuf, &headerLength, 0)) {
fprintf(stderr, "Failed to get VOL header\n");
+ fclose(fpInput);
+ fclose(fpOutput);
+ free(inputBuf);
+ free(outputBuf);
return EXIT_FAILURE;
}
fwrite(outputBuf, 1, headerLength, fpOutput);