[FFmpeg-devel] [PATCH] avformat: remove request_probe assert from ff_read_packet

Michael Niedermayer michael at niedermayer.cc
Wed Oct 19 23:45:19 EEST 2016


On Wed, Oct 19, 2016 at 07:27:59PM +0200, Andreas Cadhalpun wrote:
> On 19.10.2016 05:29, Michael Niedermayer wrote:
> > hmm, i guess the patch is then ok
> > alternatively you could use i think:
> > @@ -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);
> 
> Yes, this works fine and should guarantee that the assert can't be triggered.
> Patch doing it that way is attached.
> 
> Best regards,
> Andreas
> 

>  utils.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> f1f2b8b10efdab27848eeb2e2bac646eda08a175  0001-avformat-prevent-triggering-request_probe-assert-in-.patch
> From 7912c6f200a37130844221a73941a7971afa6455 Mon Sep 17 00:00:00 2001
> From: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> Date: Wed, 19 Oct 2016 19:23:49 +0200
> Subject: [PATCH] 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.
> 
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
>  libavformat/utils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

LGTM

thx

[...]


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161019/f5243cd9/attachment.sig>


More information about the ffmpeg-devel mailing list