mirror of
				https://github.com/webmproject/libwebp.git
				synced 2025-10-31 10:25:46 +01:00 
			
		
		
		
	Merge "cwebp: fix crash with yuv input + lossless"
This commit is contained in:
		| @@ -64,11 +64,13 @@ extern void* VP8GetCPUInfo;   // opaque forward declaration. | |||||||
| static int verbose = 0; | static int verbose = 0; | ||||||
|  |  | ||||||
| static int ReadYUV(FILE* in_file, WebPPicture* const pic) { | static int ReadYUV(FILE* in_file, WebPPicture* const pic) { | ||||||
|  |   const int use_argb_input = pic->use_argb_input; | ||||||
|   const int uv_width = (pic->width + 1) / 2; |   const int uv_width = (pic->width + 1) / 2; | ||||||
|   const int uv_height = (pic->height + 1) / 2; |   const int uv_height = (pic->height + 1) / 2; | ||||||
|   int y; |   int y; | ||||||
|   int ok = 0; |   int ok = 0; | ||||||
|  |  | ||||||
|  |   pic->use_argb_input = 0; | ||||||
|   if (!WebPPictureAlloc(pic)) return ok; |   if (!WebPPictureAlloc(pic)) return ok; | ||||||
|  |  | ||||||
|   for (y = 0; y < pic->height; ++y) { |   for (y = 0; y < pic->height; ++y) { | ||||||
| @@ -85,6 +87,7 @@ static int ReadYUV(FILE* in_file, WebPPicture* const pic) { | |||||||
|       goto End; |       goto End; | ||||||
|   } |   } | ||||||
|   ok = 1; |   ok = 1; | ||||||
|  |   if (use_argb_input) ok = WebPPictureYUVAToARGB(pic); | ||||||
|  |  | ||||||
|  End: |  End: | ||||||
|   return ok; |   return ok; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user