Memory leak and broken audio in mjpegtools
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mjpegtools (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Binary package hint: mjpegtools
The tools in mjpegtools package leak memory and may produce corrupt audio tracks when saving as quicktime (.mov) files with different settings than 16bit/stereo.
For example, recording a sequence longer than 1 hour with the following command is impossible due to this problem:
# lavrec -i p -d 1 -q 40 -B -r 44100 -s -c 2 -l 80 -U -v 1
lavrec eventually runs out of memory and crashes with segmentation faults or things like "**ERROR: [lavrec] Error reading audio: Audio task died. Reason: Error Audio
ring buffer overflow"
The problem is located in lavtools/lav_io.c, where the free() call for the audio buffer is in the wrong place and different audio settings aren't handled properly.
This patch I created should fix this. I'm not sure if there any issues with endianess left, on i386 it works for me.