Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/_webp.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,12 +450,16 @@ _anim_decoder_get_next(PyObject *self) {
int timestamp;
PyObject *bytes;
PyObject *ret;
ImagingSectionCookie cookie;
WebPAnimDecoderObject *decp = (WebPAnimDecoderObject *)self;

ImagingSectionEnter(&cookie);
if (!WebPAnimDecoderGetNext(decp->dec, &buf, &timestamp)) {
ImagingSectionLeave(&cookie);
PyErr_SetString(PyExc_OSError, "failed to read next frame");
return NULL;
}
ImagingSectionLeave(&cookie);

bytes = PyBytes_FromStringAndSize(
(char *)buf, decp->info.canvas_width * 4 * decp->info.canvas_height);
Expand Down