Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Feb 2, 2025
1 parent 252a235 commit b417cea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/_avif.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,19 +682,20 @@ AvifDecoderNew(PyObject *self_, PyObject *args) {
decoder->codecChoice = codec;

result = avifDecoderSetIOMemory(decoder, buffer.buf, buffer.len);
PyBuffer_Release(&buffer);
if (result != AVIF_RESULT_OK) {
PyErr_Format(
exc_type_for_avif_result(result),
"Setting IO memory failed: %s",
avifResultToString(result)
);
avifDecoderDestroy(decoder);
PyBuffer_Release(&buffer);
PyObject_Del(self);
return NULL;
}

result = avifDecoderParse(decoder);
PyBuffer_Release(&buffer);
if (result != AVIF_RESULT_OK) {
PyErr_Format(
exc_type_for_avif_result(result),
Expand Down

0 comments on commit b417cea

Please sign in to comment.