mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
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>
(cherry picked from commit a5b4476a60
)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
parent
492bbe5890
commit
0009cf348a
@ -708,7 +708,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);
|
||||
|
Loading…
Reference in New Issue
Block a user