Correct error check when encoding AVIF images (#9442)

Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
This commit is contained in:
Andrew Murray 2026-02-19 23:09:59 +11:00 committed by GitHub
parent 3cd69cb12f
commit 02764a0077
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -485,7 +485,7 @@ _encoder_add(AvifEncoderObject *self, PyObject *args) {
frame = image;
} else {
frame = avifImageCreateEmpty();
if (image == NULL) {
if (frame == NULL) {
PyErr_SetString(PyExc_ValueError, "Image creation failed");
return NULL;
}