mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 09:56:17 +03:00
Fixed mistakes in error handling when PyArg_ParseTuple raises an exception.
This commit is contained in:
parent
23ed3cf4c2
commit
9608e5050e
4
_webp.c
4
_webp.c
|
@ -29,7 +29,7 @@ PyObject* WebPEncode_wrapper(PyObject* self, PyObject* args)
|
|||
if (!PyArg_ParseTuple(args, "s#iiifss#s#",
|
||||
(char**)&rgb, &size, &width, &height, &lossless, &quality_factor, &mode,
|
||||
&icc_bytes, &icc_size, &exif_bytes, &exif_size)) {
|
||||
Py_RETURN_NONE;
|
||||
return NULL;
|
||||
}
|
||||
if (strcmp(mode, "RGBA")==0){
|
||||
if (size < width * height * 4){
|
||||
|
@ -145,7 +145,7 @@ PyObject* WebPDecode_wrapper(PyObject* self, PyObject* args)
|
|||
char* mode = "RGB";
|
||||
|
||||
if (!PyArg_ParseTuple(args, "S", &webp_string)) {
|
||||
Py_RETURN_NONE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!WebPInitDecoderConfig(&config)) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user