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 ||