[FFmpeg-cvslog] avformat/format: Check for av_guess_format() failure
Michael Niedermayer
git at videolan.org
Sat Aug 2 04:30:40 CEST 2014
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Aug 2 04:16:02 2014 +0200| [98e42a249e7891d295228ff19892450ba1f09092] | committer: Michael Niedermayer
avformat/format: Check for av_guess_format() failure
Fixes null pointer dereference
Fixes Ticket3812
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=98e42a249e7891d295228ff19892450ba1f09092
---
libavformat/format.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavformat/format.c b/libavformat/format.c
index 238a13a..1c25d6b 100644
--- a/libavformat/format.c
+++ b/libavformat/format.c
@@ -145,7 +145,9 @@ enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
enum AVMediaType type)
{
if (av_match_name("segment", fmt->name) || av_match_name("ssegment", fmt->name)) {
- fmt = av_guess_format(NULL, filename, NULL);
+ AVOutputFormat *fmt2 = av_guess_format(NULL, filename, NULL);
+ if (fmt2)
+ fmt = fmt2;
}
if (type == AVMEDIA_TYPE_VIDEO) {
More information about the ffmpeg-cvslog
mailing list