[FFmpeg-devel] [PATCH 2/3] avcodec/pnm_parser: Factor out next/index compensation

Michael Niedermayer michael at niedermayer.cc
Wed Apr 10 23:38:51 EEST 2019


On Sun, Apr 07, 2019 at 09:48:36AM +0200, Paul B Mahol wrote:
> On 4/7/19, Michael Niedermayer <michael at niedermayer.cc> wrote:
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> >  libavcodec/pnm_parser.c | 10 ++++------
> >  1 file changed, 4 insertions(+), 6 deletions(-)
> >
> > diff --git a/libavcodec/pnm_parser.c b/libavcodec/pnm_parser.c
> > index 91a9edc016..95241c30b3 100644
> > --- a/libavcodec/pnm_parser.c
> > +++ b/libavcodec/pnm_parser.c
> > @@ -70,19 +70,17 @@ retry:
> >                      c = *bs++;
> >              } else if (c == 'P') {
> >                  next = bs - pnmctx.bytestream_start + skip - 1;
> > -                if (pnmctx.bytestream_start != buf + skip)
> > -                    next -= pc->index;
> >                  break;
> >              }
> >          }
> >      } else {
> >          next = pnmctx.bytestream - pnmctx.bytestream_start + skip
> >                 + av_image_get_buffer_size(avctx->pix_fmt, avctx->width,
> > avctx->height, 1);
> > -        if (pnmctx.bytestream_start != buf + skip)
> > -            next -= pc->index;
> > -        if (next > buf_size)
> > -            next = END_NOT_FOUND;
> >      }
> > +    if (next != END_NOT_FOUND && pnmctx.bytestream_start != buf + skip)
> > +        next -= pc->index;
> > +    if (next > buf_size)
> > +        next = END_NOT_FOUND;
> >
> >      if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
> >          *poutbuf      = NULL;
> > --
> > 2.21.0
> 
> probably ok

will apply

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190410/f00626ff/attachment.sig>


More information about the ffmpeg-devel mailing list