comparison libswscale/swscale-example.c @ 28973:9ae8c54007f5

Initialize *srcContext, *dstContext, *outContext to NULL, avoids the warnings: libswscale/swscale-example.c:60: warning: 'outContext' may be used uninitialized in this function libswscale/swscale-example.c:60: warning: 'dstContext' may be used uninitialized in this function libswscale/swscale-example.c:60: warning: 'srcContext' may be used uninitialized in this function
author diego
date Thu, 19 Mar 2009 23:33:35 +0000
parents 99f0c79aba05
children 3aa3a63b8a83
comparison
equal deleted inserted replaced
28972:74f99934fb48 28973:9ae8c54007f5
55 uint8_t *dst[3]; 55 uint8_t *dst[3];
56 uint8_t *out[3]; 56 uint8_t *out[3];
57 int srcStride[3], dstStride[3]; 57 int srcStride[3], dstStride[3];
58 int i; 58 int i;
59 uint64_t ssdY, ssdU, ssdV; 59 uint64_t ssdY, ssdU, ssdV;
60 struct SwsContext *srcContext, *dstContext, *outContext; 60 struct SwsContext *srcContext = NULL, *dstContext = NULL,
61 *outContext = NULL;
61 int res; 62 int res;
62 63
63 res = 0; 64 res = 0;
64 for (i=0; i<3; i++){ 65 for (i=0; i<3; i++){
65 // avoid stride % bpp != 0 66 // avoid stride % bpp != 0
82 83
83 goto end; 84 goto end;
84 } 85 }
85 } 86 }
86 87
87 dstContext = outContext = NULL;
88 srcContext= sws_getContext(w, h, PIX_FMT_YUV420P, srcW, srcH, srcFormat, flags, NULL, NULL, NULL); 88 srcContext= sws_getContext(w, h, PIX_FMT_YUV420P, srcW, srcH, srcFormat, flags, NULL, NULL, NULL);
89 if (!srcContext) { 89 if (!srcContext) {
90 fprintf(stderr, "Failed to get %s ---> %s\n", 90 fprintf(stderr, "Failed to get %s ---> %s\n",
91 sws_format_name(PIX_FMT_YUV420P), 91 sws_format_name(PIX_FMT_YUV420P),
92 sws_format_name(srcFormat)); 92 sws_format_name(srcFormat));