Opened 11 years ago

Closed 11 years ago

#11550 closed Patch - Bug Fix (fixed)

Patch for static analysis detected array index undefined in dvdringbuf.cpp

Reported by: Gary Buhrmaster <gary.buhrmaster@…> Owned by: Gary Buhrmaster <gary.buhrmaster@…>
Priority: minor Milestone: 0.27
Component: MythTV - DVD Playback Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Static analysis (scan-build) detected a potential code path that would result in calling guess_palette with the palette array not having been initialized, and indexing m_clut with an undefined value. This patch initializes the arrays.

https://github.com/garybuhrmaster/mythtv/commit/824013456f41f4c90daa1f1a3879a1c9e06c28c5

Change History (4)

comment:1 Changed 11 years ago by Gary Buhrmaster <gary.buhrmaster@…>

btw, this patch also fixes the static analysis detected alpha value (potentially) being uninitialized and passed to guess_palette, where it is used in a calculation.

comment:2 Changed 11 years ago by Gary Buhrmaster <gary.buhrmaster@…>

Owner: set to Gary Buhrmaster <gary.buhrmaster@…>
Resolution: fixed
Status: newclosed

In b578a5e6444ee5d04c00387d233ab79ddba691a3/mythtv:

Check the return code from setsockopt (in lirc.cpp)

Static analysis (coverity) identified that the return code
from setsockopt was not checked. This patch checks the
return code, with a log message if the setting fails.
(cherry picked from commit 0ae45b8598110898f4779f3bdc826e1ce5abb005)

Signed-off-by: Stuart Morgan <smorgan@…>

Fixes #11550

comment:3 Changed 11 years ago by stuartm

Milestone: unknown0.27
Resolution: fixed
Status: closednew

comment:4 Changed 11 years ago by Gary Buhrmaster <gary.buhrmaster@…>

Resolution: fixed
Status: newclosed

In ab1f79a25ae33a0451a197bd3733767a2591dbfc/mythtv:

Fix static analysis detected error regarding undefined array index in dvdringbuf.cpp

Static analysis (scan-build) detected a potential code path such that guess_palette
could be called without having the palette variables initialized, which would result
in indexing m_clut with an undefined value.
(cherry picked from commit 824013456f41f4c90daa1f1a3879a1c9e06c28c5)

Signed-off-by: Stuart Morgan <smorgan@…>

Fixes #11550

Note: See TracTickets for help on using tickets.