diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-05-05 00:56:39 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-05-13 00:35:04 +0200 |
commit | 4427e96bb1cf9372dd34d986d79d5caa57ba385a (patch) | |
tree | 347619cae8e34a3da91ffc4775037972004ec0e3 | |
parent | 731f4bb6fd4415e468ae8639b4c6d34185319256 (diff) | |
download | ffmpeg-4427e96bb1cf9372dd34d986d79d5caa57ba385a.tar.gz |
src_movie: fix scanf string
Fixes out of array accesses
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit adaa7743f5fdca0c0aca0b7ffdebf61c7d868571)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavfilter/src_movie.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c index bd45766641..ec9131ecab 100644 --- a/libavfilter/src_movie.c +++ b/libavfilter/src_movie.c @@ -91,13 +91,13 @@ static int movie_request_frame(AVFilterLink *outlink); static AVStream *find_stream(void *log, AVFormatContext *avf, const char *spec) { int i, ret, already = 0, stream_id = -1; - char type_char, dummy; + char type_char[2], dummy; AVStream *found = NULL; enum AVMediaType type; - ret = sscanf(spec, "d%[av]%d%c", &type_char, &stream_id, &dummy); + ret = sscanf(spec, "d%1[av]%d%c", type_char, &stream_id, &dummy); if (ret >= 1 && ret <= 2) { - type = type_char == 'v' ? AVMEDIA_TYPE_VIDEO : AVMEDIA_TYPE_AUDIO; + type = type_char[0] == 'v' ? AVMEDIA_TYPE_VIDEO : AVMEDIA_TYPE_AUDIO; ret = av_find_best_stream(avf, type, stream_id, -1, NULL, 0); if (ret < 0) { av_log(log, AV_LOG_ERROR, "No %s stream with index '%d' found\n", |