aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-06-19 04:02:06 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-06-19 04:02:06 +0200
commit83f9bc8aeece0d7c5b1fadaf91118ee6a97a0390 (patch)
tree187761ffb28af7cd5ee857fa919f0d1244ffdbcf /libavformat
parent15b4f6449ddb1f52ae82dee3f94a5b56b636cbea (diff)
parentdbafb0e06faa092f60e53d845957fbab7f2a3f2d (diff)
downloadffmpeg-83f9bc8aeece0d7c5b1fadaf91118ee6a97a0390.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: lavf: prevent crash in av_open_input_file() if ap == NULL. more Changelog additions lavf: add a forgotten NULL check in convert_format_parameters(). Fix build if yasm is not available. H.264: Add x86 assembly for 10-bit MC Chroma H.264 functions. Conflicts: Changelog Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3be8706d87..4fc74fa605 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -400,6 +400,9 @@ static AVDictionary *convert_format_parameters(AVFormatParameters *ap)
char buf[1024];
AVDictionary *opts = NULL;
+ if (!ap)
+ return NULL;
+
if (ap->time_base.num) {
snprintf(buf, sizeof(buf), "%d/%d", ap->time_base.den, ap->time_base.num);
av_dict_set(&opts, "framerate", buf, 0);
@@ -567,7 +570,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
int err;
AVDictionary *opts = convert_format_parameters(ap);
- if (!ap->prealloced_context)
+ if (!ap || !ap->prealloced_context)
*ic_ptr = NULL;
err = avformat_open_input(ic_ptr, filename, fmt, &opts);