[FFmpeg-trac] #8156(undetermined:closed): PVS-studio big list of errors
FFmpeg
trac at avcodec.org
Mon May 24 06:54:09 EEST 2021
#8156: PVS-studio big list of errors
-------------------------------------+-------------------------------------
Reporter: Balling | Owner: (none)
Type: defect | Status: closed
Priority: normal | Component:
| undetermined
Version: unspecified | Resolution: invalid
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Description changed by Balling:
Old description:
> Use keywords with Ctrl-F: "function" and "twice" and "false", "true"
>
> For example:
> ./libavfilter/af_headphone.c 713 warn V519 The 'ret' variable
> is assigned values twice successively. Perhaps this is a mistake. Check
> lines: 712, 713.
> ./libavfilter/vf_avgblur.c 173 warn V519 The 'ptr' variable
> is assigned values twice successively. Perhaps this is a mistake. Check
> lines: 173, 173.
> ./libavfilter/vf_avgblur.c 174 warn V519 The 'ptr' variable
> is assigned values twice successively. Perhaps this is a mistake. Check
> lines: 174, 174.
>
> There is another 27 such twice values. They are all mistakes...
>
> ./fftools/ffplay.c 2496 warn V763 Parameter
> 'wanted_nb_channels' is always rewritten in function body before being
> used. There is also such things.
>
> ./libavcodec/dirac_dwt_template.c 410 warn V751 Parameter
> 'height' is not used inside function body. And like this.
> ./libavcodec/j2kenc.c 524 err V610 Undefined behavior. Check
> the shift operator '<<'. The left operand is negative ('6 * i - (9 << (7
> - 1) - 1)' = [-288..474]). Such things...
> ./libavcodec/j2kenc.c 323 err V523 The 'then' statement is
> equivalent to the 'else' statement. And such...
> ./libavcodec/encode.c 169 warn V581 The conditional expressions
> of the 'if' statements situated alongside each other are identical. Check
> lines: 162, 169.
> ./libavcodec/dvenc.c 410 err V767 Suspicious access to element
> of 'size' array by a constant index inside a loop.
>
> ./libavcodec/dnxhdenc.c 233 warn V728 An excessive check can be
> simplified. The '||' operator is surrounded by opposite expressions
> '!offset' and 'offset'.
> ./libavcodec/dnxhdenc.c 234 warn V728 An excessive check can be
> simplified. The '||' operator is surrounded by opposite expressions
> '!run' and 'run'.
> ./libavfilter/vf_overlay.c 491 warn V728 An excessive check
> can be simplified. The '||' operator is surrounded by opposite
> expressions '!vsub' and 'vsub'.
> ./libavfilter/f_loop.c 381 warn V728 An excessive check can be
> simplified. The '||' operator is surrounded by opposite expressions
> 's->nb_frames < s->size' and 's->nb_frames >= s->size'. These are just
> great)) Etc I will try to find some others tomorrow))
New description:
Use keywords with Ctrl-F: "function" and "twice" and "false", "true"
For example:
./libavfilter/af_headphone.c 713 warn V519 The 'ret' variable is
assigned values twice successively. Perhaps this is a mistake. Check
lines: 712, 713.
./libavfilter/vf_avgblur.c 173 warn V519 The 'ptr' variable is
assigned values twice successively. Perhaps this is a mistake. Check
lines: 173, 173.
./libavfilter/vf_avgblur.c 174 warn V519 The 'ptr' variable is
assigned values twice successively. Perhaps this is a mistake. Check
lines: 174, 174.
There is another 27 such twice values. They are all mistakes...
./fftools/ffplay.c 2496 warn V763 Parameter
'wanted_nb_channels' is always rewritten in function body before being
used. There is also such things.
./libavcodec/dirac_dwt_template.c 410 warn V751 Parameter
'height' is not used inside function body. And like this.
./libavcodec/j2kenc.c 524 err V610 Undefined behavior. Check the
shift operator '<<'. The left operand is negative ('6 * i - (9 << (7 - 1)
- 1)' = [-288..474]). Such things...
./libavcodec/j2kenc.c 323 err V523 The 'then' statement is
equivalent to the 'else' statement. And such...
./libavcodec/encode.c 169 warn V581 The conditional expressions
of the 'if' statements situated alongside each other are identical. Check
lines: 162, 169.
./libavcodec/dvenc.c 410 err V767 Suspicious access to element
of 'size' array by a constant index inside a loop.
./libavcodec/dnxhdenc.c 233 warn V728 An excessive check can be
simplified. The or operator is surrounded by opposite expressions
'!offset' and 'offset'.
./libavcodec/dnxhdenc.c 234 warn V728 An excessive check can be
simplified. The or operator is surrounded by opposite expressions '!run'
and 'run'.
./libavfilter/vf_overlay.c 491 warn V728 An excessive check
can be simplified. The or operator is surrounded by opposite expressions
'!vsub' and 'vsub'.
./libavfilter/f_loop.c 381 warn V728 An excessive check can be
simplified. The or operator is surrounded by opposite expressions
's->nb_frames < s->size' and 's->nb_frames >= s->size'. These are just
great.
--
--
Ticket URL: <https://trac.ffmpeg.org/ticket/8156#comment:13>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list