mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
Update src/_webp.c
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
parent
469db5114c
commit
c93b23239d
|
@ -448,18 +448,19 @@ PyObject *
|
|||
_anim_decoder_get_next(PyObject *self) {
|
||||
uint8_t *buf;
|
||||
int timestamp;
|
||||
int ok;
|
||||
PyObject *bytes;
|
||||
PyObject *ret;
|
||||
ImagingSectionCookie cookie;
|
||||
WebPAnimDecoderObject *decp = (WebPAnimDecoderObject *)self;
|
||||
|
||||
ImagingSectionEnter(&cookie);
|
||||
if (!WebPAnimDecoderGetNext(decp->dec, &buf, ×tamp)) {
|
||||
ImagingSectionLeave(&cookie);
|
||||
ok = WebPAnimDecoderGetNext(decp->dec, &buf, ×tamp)
|
||||
ImagingSectionLeave(&cookie);
|
||||
if (!ok) {
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user