Coverity DIVIDE_BY_ZERO - CID 10477

Bug #937535 reported by Product Strategy Coverity Bug Uploader on 2012-02-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
notify-osd (Ubuntu)
Medium
Unassigned

Bug Description

This bug is exported from the Coverity Integration Manager on Canonical's servers. For information on how this is done please see this website: https://wiki.ubuntu.com/CanonicalProductStrategy/Coverity
CID: 10477
Checker: DIVIDE_BY_ZERO
Category: No category available
CWE definition: http://cwe.mitre.org/data/definitions/571.html
File: /tmp/buildd/notify-osd-0.9.33/egg/egg-alpha.c
Function: egg_exp_inc_func()
Code snippet:
960 #endif
961
962 timeline = egg_alpha_get_timeline (alpha);
963 frame = egg_timeline_get_current_frame (timeline);
CID 10477 - DIVIDE_BY_ZERO
Assigning: "n_frames" = "egg_timeline_get_n_frames(timeline)".
On this path, function call "egg_timeline_get_n_frames(timeline)" has return value of 0
964 n_frames = egg_timeline_get_n_frames (timeline);
965
CID 10477 - DIVIDE_BY_ZERO
Division by expression "n_frames" which may be zero has undefined behavior
966 x = x_alpha_max * frame / n_frames;
967
968 result = CLAMP (egg_pow2x (x) - 1, 0, EGG_ALPHA_MAX_ALPHA);
969

Source file with Coverity annotations.

Changed in notify-osd:
importance: Undecided → Medium
affects: notify-osd → notify-osd (Ubuntu)
no longer affects: notify-osd/oneiric
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers