Variable used uninitialized in libavcodec/ffv1enc.c
The following were observed when building N-77414-g484cc66 and should probably be fixed:
libavcodec/ffv1enc.c:434:17: warning: variable 'a' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (lbd) {
^~~
libavcodec/ffv1enc.c:457:31: note: uninitialized use occurs here
sample[3][0][x] = a;
^
libavcodec/ffv1enc.c:434:13: note: remove the 'if' if its condition is always true
if (lbd) {
^~~~~~~~~
libavcodec/ffv1enc.c:433:13: note: variable 'a' is declared here
int b, g, r, av_uninit(a);
^
Change History
(4)
Keywords: |
ffv1 added
|
Priority: |
normal → minor
|
Version: |
unspecified → git-master
|
Summary: |
Variables used uninitialized in libavcodec/ffv1enc.c → Variable used uninitialized in libavcodec/ffv1enc.c
|
Resolution: |
→ wontfix
|
Status: |
new → closed
|
The warning was originally addressed in 0b23452c01c5f8145de111f09c0e9a7d5bd82068
When encoding RGB >8 bit, line 453 reads from an uninitialized value:
sample[3][0][x] will not be used afterwards.
I suspect this is speed-critical code, a possible workaround would be to manually unroll the
for (p = 0; p < 3 + s->transparency; p++) {
loop in line 455 and move the above assignment in the transparency part of the unrolled loop. This may still incorrectly trigger the warning though.