Found !

* A52 plugin allocates an input buffer at pcm_a52.c:556:
        if (av_samples_alloc(rec->frame->data, rec->frame->linesize,
                             io->channels, rec->avctx->frame_size,
                             rec->avctx->sample_fmt, 0) < 0)

* The last parameter which equals 0 is "align":
http://libav.org/doxygen/master/samplefmt_8h.html#a4db4c77f928d32c7d8854732f50b8c04

* The problem is in libavutil::av_samples_get_buffer_size(). The parameter 
"align" is not checked if it equals 0. And the following crash, division by 0
        if (nb_channels > INT_MAX / align ||

* I suggest the following patch, based on FFMpeg source code:
http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavutil/samplefmt.c;h=08ecc834678eced8c3029095a824d8ae9d29406a;hb=HEAD#l137

* I tested it on Ubuntu 13.10 64 bit and it works :-)


---------------------------
Libav patch
---------------------------

--- libavutil/samplefmt_origine.c       2013-05-12 09:08:17.000000000 +0200
+++ libavutil/samplefmt.c       2014-01-21 20:04:45.272527345 +0100
@@ -104,6 +104,12 @@
     if (!sample_size || nb_samples <= 0 || nb_channels <= 0)
         return AVERROR(EINVAL);
 
+       /* auto-select alignment if not specified */
+    if (!align) {
+         align = 1;
+         nb_samples = FFALIGN(nb_samples, 32);
+    }
+
     /* check for integer overflow */
     if (nb_channels > INT_MAX / align ||
         (int64_t)nb_channels * nb_samples > (INT_MAX - (align * nb_channels)) 
/ sample_size)

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to alsa-plugins in Ubuntu.
https://bugs.launchpad.net/bugs/1241439

Title:
  [a52 plugin] no sound/audio,  traps: pulseaudio[25921] trap divide
  error ip:7fe46a303a57 sp:7fff825b91d0 error:0 in libavutil.so.51.22.1

Status in “alsa-plugins” package in Ubuntu:
  Confirmed

Bug description:
  upgraded to 13.10 64 bit
  no sound at all
  aplay lists the devices

  syslog is full of repeating messages:
  desktop kernel: [  891.907148] traps: pulseaudio[19742] trap divide error 
ip:7fde05efca57 sp:7fff94bff400 error:0 in 
libavutil.so.51.22.1[7fde05ee9000+1c000]
  Oct 18 00:57:11 desktop pulseaudio[19746]: [pulseaudio] pid.c: Stale PID 
file, overwriting.
  Oct 18 00:57:11 desktop pulseaudio[19743]: [pulseaudio] main.c: Daemon 
startup failed.

  had to turn off respawning in client.conf

  ProblemType: Bug
  DistroRelease: Ubuntu 13.10
  Package: pulseaudio 1:4.0-0ubuntu6
  ProcVersionSignature: Ubuntu 3.11.0-12.19-generic 3.11.3
  Uname: Linux 3.11.0-12-generic x86_64
  ApportVersion: 2.12.5-0ubuntu2
  Architecture: amd64
  AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/by-path', 
'/dev/snd/controlC1', '/dev/snd/hwC1D0', '/dev/snd/pcmC1D3p', 
'/dev/snd/controlC0', '/dev/snd/hwC0D2', '/dev/snd/pcmC0D0c', 
'/dev/snd/pcmC0D0p', '/dev/snd/pcmC0D1p', '/dev/snd/pcmC0D2c', 
'/dev/snd/pcmC0D2p', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
  Date: Fri Oct 18 11:47:26 2013
  InstallationDate: Installed on 2013-04-30 (170 days ago)
  InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64 (20130424)
  MarkForUpload: True
  PulseList: Error: command ['pacmd', 'list'] failed with exit code 1: No 
PulseAudio daemon running, or not running as session daemon.
  SourcePackage: pulseaudio
  UpgradeStatus: Upgraded to saucy on 2013-10-17 (0 days ago)
  dmi.bios.date: 08/21/2012
  dmi.bios.vendor: American Megatrends Inc.
  dmi.bios.version: F11
  dmi.board.asset.tag: To be filled by O.E.M.
  dmi.board.name: H77-D3H
  dmi.board.vendor: Gigabyte Technology Co., Ltd.
  dmi.board.version: x.x
  dmi.chassis.asset.tag: To Be Filled By O.E.M.
  dmi.chassis.type: 3
  dmi.chassis.vendor: Gigabyte Technology Co., Ltd.
  dmi.chassis.version: To Be Filled By O.E.M.
  dmi.modalias: 
dmi:bvnAmericanMegatrendsInc.:bvrF11:bd08/21/2012:svnGigabyteTechnologyCo.,Ltd.:pnTobefilledbyO.E.M.:pvrTobefilledbyO.E.M.:rvnGigabyteTechnologyCo.,Ltd.:rnH77-D3H:rvrx.x:cvnGigabyteTechnologyCo.,Ltd.:ct3:cvrToBeFilledByO.E.M.:
  dmi.product.name: To be filled by O.E.M.
  dmi.product.version: To be filled by O.E.M.
  dmi.sys.vendor: Gigabyte Technology Co., Ltd.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/alsa-plugins/+bug/1241439/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to