Opened 13 years ago

Closed 13 years ago

#4388 closed defect (fixed)

mytharchivehelper problem with getfileinfo and method 0

Reported by: michele.sardo@… Owned by: paulh
Priority: minor Milestone: 0.21
Component: mytharchive Version: head
Severity: low Keywords:
Cc: Ticket locked: no


mytharchivehelper in version 0.20.2 makes an approximation due to a misplaced cast in the function getFileInfo. In particular on main.cpp line 1951, the original code:

root.setAttribute("duration", (uint) inputFC->duration / AV_TIME_BASE);

should be replaced by:

root.setAttribute("duration", (uint) (inputFC->duration / AV_TIME_BASE));

since casting has precedence over division and so the calculation is wrong in some cases, because inputFC->duration can easily exceed 232-1 since it is expressed in microseconds.

Change History (3)

comment:1 Changed 13 years ago by stuartm

Component: mythtvmytharchive
Milestone: unknown0.21
Owner: changed from Isaac Richards to paulh

comment:2 Changed 13 years ago by paulh

Status: newaccepted
Version: 0.20.2head

comment:3 Changed 13 years ago by paulh

Resolution: fixed
Status: acceptedclosed

(In [15259]) Fix a misplaced cast spotted by Michele Sardo. Fixes #4388.

Note: See TracTickets for help on using tickets.