aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2011-09-30 20:30:35 +0300
committerReinhard Tartler <siretart@tauware.de>2012-03-18 17:50:17 +0100
commit151aaf539f0d1010471f916082742b3d80da1359 (patch)
tree604d5399575da9f7d52f6e11d1d21d919d0f7e93
parentf74a4b621fed92f964ed58bae00721f8785fe90b (diff)
downloadffmpeg-151aaf539f0d1010471f916082742b3d80da1359.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) Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r--libavformat/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index aa3ca5990b..65176d416f 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3320,7 +3320,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;