1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
FFmpeg/libavdevice
Antonio Ospite d3958ab4ed x11grab: fix a memory leak exposed by valgrind
When using "-f x11grab -i :0.0" valgrind reports a definitely lost
memory block with this message:

==31544== 5 bytes in 1 blocks are definitely lost in loss record 1 of 2
==31544==    at 0x4026E68: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31544==    by 0x4026F17: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31544==    by 0x60D399A: av_malloc (in /usr/lib/x86_64-linux-gnu/libavutil.so.51.22.1)
==31544==    by 0x60D3A70: av_strdup (in /usr/lib/x86_64-linux-gnu/libavutil.so.51.22.1)
==31544==    by 0x4A2BE58: ??? (in /usr/lib/x86_64-linux-gnu/libavdevice.so.53.2.0)
==31544==    by 0x506D29E: avformat_open_input (in /usr/lib/x86_64-linux-gnu/libavformat.so.53.21.0)
==31544==    by 0x400A80: main (in /home/ao2/WIP/am7xxx-play/tests/a.out)

The 5 bytes lost are the ones from param = av_strdup(":0.0"), so let's
free param in the exit path.

Also check the av_strdup() return value.

Note: calling av_free(param) even when av_strdup() fails and param is
NULL is OK and keeps the code simpler without adding another label to
skip av_free().

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-03-16 15:39:33 -07:00
..
alldevices.c lavd: remove deprecated v4l grab device. 2012-01-24 18:04:19 +01:00
alsa-audio-common.c Make channel layout masks unsigned 2011-11-25 13:19:54 +00:00
alsa-audio-dec.c lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
alsa-audio-enc.c Use explicit struct initializers for AVOutputFormat/AVInputFormat declarations. 2011-09-24 12:11:17 +02:00
alsa-audio.h alsa: limit buffer_size to 32768 frames. 2011-07-09 16:01:06 -04:00
avdevice.c Replace FFmpeg with Libav in licence headers 2011-03-19 13:33:20 +00:00
avdevice.h cosmetics: Remove extra newlines at EOF 2012-01-27 17:19:09 -08:00
bktr.c lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
dv1394.c lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
dv1394.h Replace FFmpeg with Libav in licence headers 2011-03-19 13:33:20 +00:00
fbdev.c lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
jack_audio.c lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
libavdevice.v Add symbol versioning for shared libraries 2010-01-16 04:49:02 +00:00
libcdio.c libcdio: add a forgotten AVClass to the private context. 2012-03-04 21:01:41 +01:00
libdc1394.c lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
Makefile lavd: remove deprecated v4l grab device. 2012-01-24 18:04:19 +01:00
oss_audio.c lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
pulse.c lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
sndio_common.c sndio bug fix 2011-03-29 21:19:39 -07:00
sndio_common.h sndio: add channels and sample_rate private options. 2011-05-25 15:20:26 +02:00
sndio_dec.c lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
sndio_enc.c oss,sndio: simplify by using FFMIN. 2011-06-09 22:53:17 +02:00
timefilter.c 4xm, timefilter: K&R formatting cosmetics 2012-02-10 15:48:50 +01:00
timefilter.h Fix a bunch of common typos. 2011-12-11 00:32:25 +01:00
v4l2.c lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
vfwcap.c lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
x11grab.c x11grab: fix a memory leak exposed by valgrind 2012-03-16 15:39:33 -07:00