Opened 12 years ago

Closed 12 years ago

#4837 closed defect (fixed)

check of shm_img pointer in ChromaKeyOSD::AllocImage() should be done before shm_img is dereferenced

Reported by: Erik Hovland <erik@…> Owned by: danielk
Priority: minor Milestone: 0.22
Component: mythtv Version: 0.21-fixes
Severity: low Keywords:
Cc: Ticket locked: no

Description

shm_img is dereferenced before it is checked:

    uint size = shm_img->bytes_per_line * (shm_img->height+1) + 128;
    X11U;

    if (shm_img)

Which means the caller of this member function will segfault if the shm call didn't work.

Attachments (1)

libs_libmythtv_osdchromakey.cpp-move-up-null-check.patch (2.0 KB) - added by Erik Hovland <erik@…> 12 years ago.
moves the null pointer check up before the first dereference

Download all attachments as: .zip

Change History (4)

Changed 12 years ago by Erik Hovland <erik@…>

moves the null pointer check up before the first dereference

comment:1 Changed 12 years ago by Isaac Richards

Milestone: 0.210.22

comment:2 Changed 12 years ago by danielk

Owner: changed from Isaac Richards to danielk
Status: newassigned

comment:3 Changed 12 years ago by danielk

Resolution: fixed
Status: assignedclosed

(In [16527]) Fixes #4837. Don't dereference pointer before checking for null after xshm allocation...

Note: See TracTickets for help on using tickets.