Merge "m4v_h263_enc_test: Fix leaks in error cases"

gugelfrei
Treehugger Robot 5 years ago committed by Gerrit Code Review
commit bd88535d65

@ -183,6 +183,10 @@ int main(int argc, char *argv[]) {
// 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 @@ int main(int argc, char *argv[]) {
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);

Loading…
Cancel
Save