Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dfe305a9 authored by Greg Kaiser's avatar Greg Kaiser Committed by android-build-merger
Browse files

Merge "m4v_h263_enc_test: Fix leaks in error cases"

am: bd88535d

Change-Id: I1c3708129cf0baf15e74af42d46d4afc6ea266c4
parents 17c029a8 bd88535d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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);