[FFmpeg-cvslog] indeo3: fix motion vector validation

Michael Niedermayer michaelni at gmx.at
Thu Jan 26 20:05:28 CET 2012


On Thu, Jan 26, 2012 at 08:39:51AM +0100, Reimar Döffinger wrote:
> 
> 
> On 25 Jan 2012, at 21:27, git at videolan.org (Hendrik Leppkes) wrote:
> 
> > ffmpeg | branch: master | Hendrik Leppkes <h.leppkes at gmail.com> | Wed Jan 25 17:37:26 2012 +0100| [6071644287d2a7471d906b688cb7253a5ceaaa8a] | committer: Michael Niedermayer
> > 
> > indeo3: fix motion vector validation
> > 
> > The index of the motion vector has to be checked before being
> > multiplied by 2 for the array index.
> > 
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > 
> >> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6071644287d2a7471d906b688cb7253a5ceaaa8a
> > ---
> > 
> > libavcodec/indeo3.c |    5 ++---
> > 1 files changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
> > index ce84d72..fc38f5e 100644
> > --- a/libavcodec/indeo3.c
> > +++ b/libavcodec/indeo3.c
> > @@ -772,13 +772,12 @@ static int parse_bintree(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
> >                 /* get motion vector index and setup the pointer to the mv set */
> >                 if (!ctx->need_resync)
> >                     ctx->next_cell_data = &ctx->gb.buffer[(get_bits_count(&ctx->gb) + 7) >> 3];
> > -                if(ctx->mc_vectors)
> > -                    mv_idx = *(ctx->next_cell_data++) << 1;
> > +                mv_idx = *(ctx->next_cell_data++);
> 
> The commit message doesn't quite explain why the if was removed though.

the if() originates from a time when ctx->mc_vectors[] was dereferenced
there
its removial should make no real difference.

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20120126/2d74e230/attachment.asc>


More information about the ffmpeg-cvslog mailing list