diff options
author | Martin Storsjö <martin@martin.st> | 2011-09-30 20:30:35 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-10-01 20:57:04 +0200 |
commit | 932b5f3cbb22b9357d60914f85675020041299e0 (patch) | |
tree | 04aee3676408d1e34eeea116bf757f768f41be9f /libavformat/utils.c | |
parent | b8ab1adfcdb1f87e3e26425b4499046352009f29 (diff) | |
download | ffmpeg-932b5f3cbb22b9357d60914f85675020041299e0.tar.gz |
lavf: Avoid using av_malloc(0) in av_dump_format
On OS X, av_malloc(0) returns pointers that cause crashes when
freed.
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e81e5e8ad2bb5746df0c343c396019aca165cf66)
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index eaa8bd901f..e79f98e62d 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3437,7 +3437,7 @@ void av_dump_format(AVFormatContext *ic, int is_output) { int i; - uint8_t *printed = av_mallocz(ic->nb_streams); + uint8_t *printed = ic->nb_streams ? av_mallocz(ic->nb_streams) : NULL; if (ic->nb_streams && !printed) return; |