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

Commit bd88535d authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "m4v_h263_enc_test: Fix leaks in error cases"

parents fb208d46 50d2ce03
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);