Opened 13 years ago

Closed 13 years ago

#10809 closed Patch - Bug Fix (Fixed)

[PATCH] libmyth: Prevent an access violation by the ALSA library

Reported by: Lawrence Rust <lvr@…> Owned by: JYA
Priority: minor Milestone: unknown
Component: MythTV - Audio Output Version: Master Head
Severity: medium Keywords: ALSA snd_device_name_hint
Cc: Ticket locked: no

Description

In audiooutputalsa.cpp, AudioOutputALSA::GetDevices? calls the ALSA API snd_device_name_hint with a card index of -1 to obtain a list of hints for all cards. Unfortunately, with libasound.so.2.0 this API can cause an access violation when the card index is -1. See http://code.google.com/p/chromium/issues/detail?id=95797

Running with valgrind shows that snd_device_name_hint makes reference to previously freed memory when called with a card index of -1.

This patch enumerates the cards using other ALSA APIs, thus avoiding the SEGV.

The access violation is often seen when starting from an empty dbase and attempting to enter the audio setup screen. The bug also applies to fixes/0.25 and 0.24.

Attachments (2)

0001-libmyth-Prevent-an-access-violation-by-the-ALSA-libr.patch (3.1 KB) - added by Lawrence Rust <lvr@…> 13 years ago.
0001-libmyth-Prevent-an-access-violation-by-the-ALSA-libr.2.patch (3.2 KB) - added by Lawrence Rust <lvr@…> 13 years ago.

Download all attachments as: .zip

Change History (6)

Changed 13 years ago by Lawrence Rust <lvr@…>

comment:1 Changed 13 years ago by JYA

Interesting...

That specific code is a direct rip of alsautils' aplay -L that lists all the devices

comment:2 Changed 13 years ago by JYA

Status: newaccepted

Changed 13 years ago by Lawrence Rust <lvr@…>

comment:3 Changed 13 years ago by Lawrence Rust <lvr@…>

Updated patch fixes a problem where not all devices were enumerated.

comment:4 Changed 13 years ago by JYA

Resolution: Fixed
Status: acceptedclosed

Fixed in c35c00385f781e6736026848d54d75ffa6006219

Thanks for the patch

Note: See TracTickets for help on using tickets.