Opened 16 months ago

Closed 2 months 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 cehoyos)

[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 Changed 3 months ago by richardpl

  • Resolution set to wontfix
  • Status changed from new to closed

Explanation not descriptive enough.

comment:2 Changed 3 months ago by cehoyos

  • Component changed from undetermined to avformat
  • Description modified (diff)
  • Keywords nut added
  • Reproduced by developer set
  • Resolution wontfix deleted
  • Status changed from closed to reopened
  • Version changed from unspecified to git-master

comment:3 Changed 3 months ago by cehoyos

  • Description modified (diff)

comment:4 Changed 2 months ago by richardpl

  • Resolution set to invalid
  • Status changed from reopened to closed

I see nothing wrong, both lines are same.

comment:5 Changed 2 months ago by dcb

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 Changed 2 months ago by richardpl

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

comment:7 Changed 2 months ago by cehoyos

  • Resolution invalid deleted
  • Status changed from closed to reopened

comment:8 Changed 2 months ago by richardpl

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.