[FFmpeg-cvslog] lavf: Avoid using av_malloc(0) in av_dump_format
Martin Storsjö
git at videolan.org
Sat Oct 1 03:06:41 CEST 2011
ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Fri Sep 30 20:30:35 2011 +0300| [e81e5e8ad2bb5746df0c343c396019aca165cf66] | committer: Martin Storsjö
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 at martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e81e5e8ad2bb5746df0c343c396019aca165cf66
---
libavformat/utils.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavformat/utils.c b/libavformat/utils.c
index d0ad358..0ba6fc3 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3333,7 +3333,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;
More information about the ffmpeg-cvslog
mailing list