ZeroDivisionError: float division by zero

Bug #1154416 reported by Victor Trac
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenShot Video Editor
New
Undecided
Unassigned

Bug Description

1) Ubuntu 12.10
2) apt-get install openshot
3) Openshot 1.4.3
4) melt 0.8.0

I was adding a still image to a track and messing with the fades. I'm not sure what happened, but OpenShot crashed. It must have saved the project right before the crash, because all subsequent tries to open the file resulted in OpenShot crashing. Running OpenShot from the command line showed a ZeroDivisionError:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openshot/windows/MainGTK.py", line 881, in recent_item_activated
    self.open_project(file_to_open)
  File "/usr/lib/pymodules/python2.7/openshot/windows/MainGTK.py", line 886, in open_project
    self.project.Open(file_to_open)
  File "/usr/lib/pymodules/python2.7/openshot/classes/project.py", line 347, in Open
    open_project.open_project(self, file_path)
  File "/usr/lib/pymodules/python2.7/openshot/classes/open_project.py", line 123, in open_project
    project_object.RefreshXML()
  File "/usr/lib/pymodules/python2.7/openshot/classes/project.py", line 287, in RefreshXML
    self.GenerateXML(os.path.join(self.USER_DIR, "sequence.mlt"))
  File "/usr/lib/pymodules/python2.7/openshot/classes/project.py", line 258, in GenerateXML
    self.sequences[0].GenerateXML(dom, tractor1)
  File "/usr/lib/pymodules/python2.7/openshot/classes/sequences.py", line 232, in GenerateXML
    MyTrack.GenerateXML(dom, multitrack, fps=fps)
  File "/usr/lib/pymodules/python2.7/openshot/classes/track.py", line 111, in GenerateXML
    current_frame = MyClip.GenerateXML(dom, playlist, current_frame, fps=fps)
  File "/usr/lib/pymodules/python2.7/openshot/classes/clip.py", line 654, in GenerateXML
    self.GenerateComposites(dom, current_frame, ending_frame, preview_mode, fps=fps)
  File "/usr/lib/pymodules/python2.7/openshot/classes/clip.py", line 754, in GenerateComposites
    self.CreateCompositeXML(dom, current_frame, end, "fade in", fps=fps)
  File "/usr/lib/pymodules/python2.7/openshot/classes/clip.py", line 829, in CreateCompositeXML
    h1, h2 = self.get_keyframe_values("height", current_frame, end_frame, fps, clip_length_frames, kf_start, kf_end)
  File "/usr/lib/pymodules/python2.7/openshot/classes/clip.py", line 1026, in get_keyframe_values
    units = prop_diff / clip_length_frames
ZeroDivisionError: float division by zero

Editing /usr/lib/pymodules/python2.7/openshot/classes/clip.py with this fixed my problem:

- if prop_diff != 0:
+ if prop_diff != 0 and clip_length_frames > 0.0:

Revision history for this message
Olivier Girard (eolinwen) wrote : Re: [Openshot.bugs] [Bug 1154416] [NEW] ZeroDivisionError: float division by zero
Download full text (6.6 KiB)

Hi,

Please report a bug following this FAQ :
https://answers.launchpad.net/openshot/+faq/2197

You should update your version of MLT. Take a look at this other FAQ :
https://answers.launchpad.net/openshot/+faq/1861

Thanks.

2013/3/13 Victor Trac <email address hidden>

> Public bug reported:
>
> 1) Ubuntu 12.10
> 2) apt-get install openshot
> 3) Openshot 1.4.3
> 4) melt 0.8.0
>
> I was adding a still image to a track and messing with the fades. I'm
> not sure what happened, but OpenShot crashed. It must have saved the
> project right before the crash, because all subsequent tries to open the
> file resulted in OpenShot crashing. Running OpenShot from the command
> line showed a ZeroDivisionError:
>
> Traceback (most recent call last):
> File "/usr/lib/pymodules/python2.7/openshot/windows/MainGTK.py", line
> 881, in recent_item_activated
> self.open_project(file_to_open)
> File "/usr/lib/pymodules/python2.7/openshot/windows/MainGTK.py", line
> 886, in open_project
> self.project.Open(file_to_open)
> File "/usr/lib/pymodules/python2.7/openshot/classes/project.py", line
> 347, in Open
> open_project.open_project(self, file_path)
> File "/usr/lib/pymodules/python2.7/openshot/classes/open_project.py",
> line 123, in open_project
> project_object.RefreshXML()
> File "/usr/lib/pymodules/python2.7/openshot/classes/project.py", line
> 287, in RefreshXML
> self.GenerateXML(os.path.join(self.USER_DIR, "sequence.mlt"))
> File "/usr/lib/pymodules/python2.7/openshot/classes/project.py", line
> 258, in GenerateXML
> self.sequences[0].GenerateXML(dom, tractor1)
> File "/usr/lib/pymodules/python2.7/openshot/classes/sequences.py", line
> 232, in GenerateXML
> MyTrack.GenerateXML(dom, multitrack, fps=fps)
> File "/usr/lib/pymodules/python2.7/openshot/classes/track.py", line 111,
> in GenerateXML
> current_frame = MyClip.GenerateXML(dom, playlist, current_frame,
> fps=fps)
> File "/usr/lib/pymodules/python2.7/openshot/classes/clip.py", line 654,
> in GenerateXML
> self.GenerateComposites(dom, current_frame, ending_frame,
> preview_mode, fps=fps)
> File "/usr/lib/pymodules/python2.7/openshot/classes/clip.py", line 754,
> in GenerateComposites
> self.CreateCompositeXML(dom, current_frame, end, "fade in", fps=fps)
> File "/usr/lib/pymodules/python2.7/openshot/classes/clip.py", line 829,
> in CreateCompositeXML
> h1, h2 = self.get_keyframe_values("height", current_frame, end_frame,
> fps, clip_length_frames, kf_start, kf_end)
> File "/usr/lib/pymodules/python2.7/openshot/classes/clip.py", line 1026,
> in get_keyframe_values
> units = prop_diff / clip_length_frames
> ZeroDivisionError: float division by zero
>
> Editing /usr/lib/pymodules/python2.7/openshot/classes/clip.py with this
> fixed my problem:
>
> - if prop_diff != 0:
> + if prop_diff != 0 and clip_length_frames > 0.0:
>
> ** Affects: openshot
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are a member of OpenShot
> Bugs, which is subscribed to OpenShot Video Editor.
> https://bugs.launchpad.net/bugs/1154416
>
> Title:
> ZeroDivisionError: float...

Read more...

Revision history for this message
Andy Finch (fincha) wrote :

There was another similar bug fixed in 1.4.3, #1014059, so I would guess this has a similar cause. Don't think it's anything to do with MLT.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.