diff options
author | Janne Grunau <janne-libav@jannau.net> | 2012-09-07 16:27:21 +0200 |
---|---|---|
committer | Janne Grunau <janne-libav@jannau.net> | 2012-09-20 14:50:06 +0200 |
commit | 6746cd7f61964f94f949606f839598861472dcff (patch) | |
tree | b228217a9c575da0a1e8836580716b8b79fec801 | |
parent | a34a609fc1c21f6ab07ce0469e38c76a2ae077d1 (diff) | |
download | ffmpeg-6746cd7f61964f94f949606f839598861472dcff.tar.gz |
lavf probe: prevent codec probe with no data at all seen
This occurs with fuzzed mpeg-ts files. set_codec_from_probe_data() is
called with a zeroed AVProbeData since no packet made through for
specific stream.
-rw-r--r-- | libavformat/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index e4e4a8b445..64be7c8700 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -625,6 +625,11 @@ static void probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt) memset(pd->buf+pd->buf_size, 0, AVPROBE_PADDING_SIZE); } else { st->probe_packets = 0; + if (!pd->buf_size) { + av_log(s, AV_LOG_ERROR, "nothing to probe for stream %d\n", + st->index); + return; + } } if (!st->probe_packets || |