diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2021-11-08 11:14:07 +0100 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2021-11-08 11:14:07 +0100 |
commit | dbf210ca3b48bf446b0ebca7dceac2fe412d5fbc (patch) | |
tree | ed16d02e7413baaea85188733a69b477ddfac951 | |
parent | 2d8584dad450f4904f968e5bcbfd6351dd0b55ef (diff) | |
download | v4l-utils-dbf210ca3b48bf446b0ebca7dceac2fe412d5fbc.tar.gz |
decode_tm6000: fix compiler warning
decode_tm6000.c: In function ‘main’:
decode_tm6000.c:354:25: warning: ‘img’ may be used uninitialized [-Wmaybe-uninitialized]
354 | memcpy(buf,&img[pos],sizeof(buf));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
decode_tm6000.c:253:48: note: ‘img’ declared here
253 | unsigned char buf[TM6000_URB_MSG_LEN], img[720*2*480];
| ^~~
Just initialize img to all 0.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r-- | contrib/decode_tm6000/decode_tm6000.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/decode_tm6000/decode_tm6000.c b/contrib/decode_tm6000/decode_tm6000.c index bd9b2dd4..564b22dc 100644 --- a/contrib/decode_tm6000/decode_tm6000.c +++ b/contrib/decode_tm6000/decode_tm6000.c @@ -250,7 +250,7 @@ int main (int argc, char*argv[]) { int fd; unsigned int i; - unsigned char buf[TM6000_URB_MSG_LEN], img[720*2*480]; + unsigned char buf[TM6000_URB_MSG_LEN], img[720*2*480] = {}; unsigned int cmd, size, field, block, line, pos=0; unsigned long header=0; int linesize=720*2,skip=0; |