Opened 6 years ago

Closed 5 years ago

#6742 closed defect (fixed)

ffmpeg-3.4/libavformat/nutdec.c:585: suspicious if ?

Reported by: dcb Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: nut
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description (last modified by Carl Eugen Hoyos)

[ffmpeg-3.4/libavformat/nutdec.c:585]: (style) Same expression on both sides of '||'.

Source code is

                if (st->r_frame_rate.num >= 1000LL*st->r_frame_rate.den ||
                    st->r_frame_rate.num < 0 || st->r_frame_rate.num < 0)

maybe better code

                if (st->r_frame_rate.num >= 1000LL*st->r_frame_rate.den ||
                    st->r_frame_rate.num < 0 || st->r_frame_rate.den < 0)

Change History (8)

comment:1 by Elon Musk, 5 years ago

Resolution: wontfix
Status: newclosed

Explanation not descriptive enough.

comment:2 by Carl Eugen Hoyos, 5 years ago

Component: undeterminedavformat
Description: modified (diff)
Keywords: nut added
Reproduced by developer: set
Resolution: wontfix
Status: closedreopened
Version: unspecifiedgit-master

comment:3 by Carl Eugen Hoyos, 5 years ago

Description: modified (diff)

comment:4 by Elon Musk, 5 years ago

Resolution: invalid
Status: reopenedclosed

I see nothing wrong, both lines are same.

comment:5 by dcb, 5 years ago

Suggest have another look, using Mark 1 eyeball.

Original code says something like

if (num >= 1000 * den

num < 0 num < 0)

That looks wrong to me. Suggest new code

if (num >= 1000 * den

num < 0 den < 0)

Looks a bit more rational to me.

comment:6 by Elon Musk, 5 years ago

Next time use bold/italic/colors. Patch sent to mailing-list.

comment:7 by Carl Eugen Hoyos, 5 years ago

Resolution: invalid
Status: closedreopened

comment:8 by Elon Musk, 5 years ago

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.