Skip to content

Commit abb6516

Browse files
committed
Move the avifCodecSpecificOptionsClear() call
In avifEncoderAddImageInternal(), move the avifCodecSpecificOptionsClear() call after the last statement that may fail, so that we can simply say that avifEncoderAddImageInternal() calls avifCodecSpecificOptionsClear() before it returns AVIF_RESULT_OK.
1 parent 37dc20b commit abb6516

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/write.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2121,10 +2121,10 @@ static avifResult avifEncoderAddImageInternal(avifEncoder * encoder,
21212121
}
21222122
}
21232123

2124-
avifCodecSpecificOptionsClear(encoder->csOptions);
21252124
avifEncoderFrame * frame = (avifEncoderFrame *)avifArrayPush(&encoder->data->frames);
21262125
AVIF_CHECKERR(frame != NULL, AVIF_RESULT_OUT_OF_MEMORY);
21272126
frame->durationInTimescales = durationInTimescales;
2127+
avifCodecSpecificOptionsClear(encoder->csOptions);
21282128
return AVIF_RESULT_OK;
21292129
}
21302130

0 commit comments

Comments
 (0)