Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1125)

Unified Diff: third_party/libwebp/enc/picture_csp.c

Issue 2149863002: libwebp: update to v0.5.1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libwebp/enc/picture.c ('k') | third_party/libwebp/enc/picture_psnr.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libwebp/enc/picture_csp.c
diff --git a/third_party/libwebp/enc/picture_csp.c b/third_party/libwebp/enc/picture_csp.c
index 0ef5f9eee2921d1b7355dbd6fd4d3684876f7fe4..607a6240b04541c242a19ade3b7113e989d33b86 100644
--- a/third_party/libwebp/enc/picture_csp.c
+++ b/third_party/libwebp/enc/picture_csp.c
@@ -1125,32 +1125,44 @@ static int Import(WebPPicture* const picture,
int WebPPictureImportRGB(WebPPicture* picture,
const uint8_t* rgb, int rgb_stride) {
- return (picture != NULL) ? Import(picture, rgb, rgb_stride, 3, 0, 0) : 0;
+ return (picture != NULL && rgb != NULL)
+ ? Import(picture, rgb, rgb_stride, 3, 0, 0)
+ : 0;
}
int WebPPictureImportBGR(WebPPicture* picture,
const uint8_t* rgb, int rgb_stride) {
- return (picture != NULL) ? Import(picture, rgb, rgb_stride, 3, 1, 0) : 0;
+ return (picture != NULL && rgb != NULL)
+ ? Import(picture, rgb, rgb_stride, 3, 1, 0)
+ : 0;
}
int WebPPictureImportRGBA(WebPPicture* picture,
const uint8_t* rgba, int rgba_stride) {
- return (picture != NULL) ? Import(picture, rgba, rgba_stride, 4, 0, 1) : 0;
+ return (picture != NULL && rgba != NULL)
+ ? Import(picture, rgba, rgba_stride, 4, 0, 1)
+ : 0;
}
int WebPPictureImportBGRA(WebPPicture* picture,
const uint8_t* rgba, int rgba_stride) {
- return (picture != NULL) ? Import(picture, rgba, rgba_stride, 4, 1, 1) : 0;
+ return (picture != NULL && rgba != NULL)
+ ? Import(picture, rgba, rgba_stride, 4, 1, 1)
+ : 0;
}
int WebPPictureImportRGBX(WebPPicture* picture,
const uint8_t* rgba, int rgba_stride) {
- return (picture != NULL) ? Import(picture, rgba, rgba_stride, 4, 0, 0) : 0;
+ return (picture != NULL && rgba != NULL)
+ ? Import(picture, rgba, rgba_stride, 4, 0, 0)
+ : 0;
}
int WebPPictureImportBGRX(WebPPicture* picture,
const uint8_t* rgba, int rgba_stride) {
- return (picture != NULL) ? Import(picture, rgba, rgba_stride, 4, 1, 0) : 0;
+ return (picture != NULL && rgba != NULL)
+ ? Import(picture, rgba, rgba_stride, 4, 1, 0)
+ : 0;
}
//------------------------------------------------------------------------------
« no previous file with comments | « third_party/libwebp/enc/picture.c ('k') | third_party/libwebp/enc/picture_psnr.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698