mirror of
				https://github.com/webmproject/libwebp.git
				synced 2025-10-31 10:25:46 +01:00 
			
		
		
		
	convert to plain-C
there were still some dandling local variables.
This commit is contained in:
		| @@ -35,6 +35,9 @@ int main(int argc, char *argv[]) { | |||||||
|   const char *out_file = NULL; |   const char *out_file = NULL; | ||||||
|   int yuv_out = 0; |   int yuv_out = 0; | ||||||
|  |  | ||||||
|  |   int width, height, stride, uv_stride; | ||||||
|  |   uint8_t* out = NULL, *u = NULL, *v = NULL; | ||||||
|  |  | ||||||
|   int c; |   int c; | ||||||
|   for (c = 1; c < argc; ++c) { |   for (c = 1; c < argc; ++c) { | ||||||
|     if (!strcmp(argv[c], "-h")) { |     if (!strcmp(argv[c], "-h")) { | ||||||
| @@ -59,9 +62,9 @@ int main(int argc, char *argv[]) { | |||||||
|     return -1; |     return -1; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   { | ||||||
|     uint32_t data_size = 0; |     uint32_t data_size = 0; | ||||||
|     void* data = NULL; |     void* data = NULL; | ||||||
|   { |  | ||||||
|     FILE* const in = fopen(in_file, "rb"); |     FILE* const in = fopen(in_file, "rb"); | ||||||
|     if (!in) { |     if (!in) { | ||||||
|       printf("cannot open input file '%s'\n", in_file); |       printf("cannot open input file '%s'\n", in_file); | ||||||
| @@ -77,10 +80,7 @@ int main(int argc, char *argv[]) { | |||||||
|       free(data); |       free(data); | ||||||
|       return -1; |       return -1; | ||||||
|     } |     } | ||||||
|   } |  | ||||||
|  |  | ||||||
|   int width, height, stride, uv_stride; |  | ||||||
|   uint8_t* out = NULL, *u = NULL, *v = NULL; |  | ||||||
|     if (!yuv_out) { |     if (!yuv_out) { | ||||||
|       out = WebPDecodeRGB(data, data_size, &width, &height); |       out = WebPDecodeRGB(data, data_size, &width, &height); | ||||||
|     } else { |     } else { | ||||||
| @@ -88,6 +88,7 @@ int main(int argc, char *argv[]) { | |||||||
|                           &u, &v, &stride, &uv_stride); |                           &u, &v, &stride, &uv_stride); | ||||||
|     } |     } | ||||||
|     free(data); |     free(data); | ||||||
|  |   } | ||||||
|  |  | ||||||
|   if (!out) { |   if (!out) { | ||||||
|     printf("Decoding of %s failed.\n", in_file); |     printf("Decoding of %s failed.\n", in_file); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user