diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-10-19 19:23:49 +0200 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-10-19 23:13:28 +0200 |
commit | a5b4476a602f31e451b11ca0c18bc92be130a50e (patch) | |
tree | c3624879a4333e14ea6bc9374789ba57a268952c /libavformat/utils.c | |
parent | dfe7e5501d4acf007f66f7ad8606499f7d7dc2cb (diff) | |
download | ffmpeg-a5b4476a602f31e451b11ca0c18bc92be130a50e.tar.gz |
avformat: prevent triggering request_probe assert in ff_read_packet
If probe_codec is called with pkt == NULL, it sets probe_packets to 0
and request_probe to -1.
However, request_probe can change when calling s->iformat->read_packet
and thus a probe_packets value of 0 doesn't guarantee a request_probe
value of -1.
In that case calling probe_codec again is necessary to prevent
triggering the assert.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 8a51aea0ad..70dbfa191c 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -803,7 +803,7 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt) return ret; for (i = 0; i < s->nb_streams; i++) { st = s->streams[i]; - if (st->probe_packets) + if (st->probe_packets || st->request_probe > 0) if ((err = probe_codec(s, st, NULL)) < 0) return err; av_assert0(st->request_probe <= 0); |