aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-02 04:16:02 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-02 04:16:02 +0200
commit98e42a249e7891d295228ff19892450ba1f09092 (patch)
tree2f3587eb1e9199d5185f8f3a9e182f5fdd3cf1b4
parent26ffa8eaee2d3279b305dd7b0a82eafe28d3c856 (diff)
downloadffmpeg-98e42a249e7891d295228ff19892450ba1f09092.tar.gz
avformat/format: Check for av_guess_format() failure
Fixes null pointer dereference Fixes Ticket3812 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/format.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/format.c b/libavformat/format.c
index 238a13acd4..1c25d6b933 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) {