[FFmpeg-devel] [PATCH] lavc/rawdec: clarify code in raw_decode()

Michael Niedermayer michaelni at gmx.at
Sun Jul 1 00:53:49 CEST 2012


On Sat, Jun 30, 2012 at 03:48:54PM +0200, Stefano Sabatini wrote:
> On date Wednesday 2012-06-27 02:09:57 +0200, Michael Niedermayer encoded:
> > On Tue, Jun 26, 2012 at 01:17:19PM +0200, Stefano Sabatini wrote:
> > > Comment on an implicit assumption done by the code, helps readability.
> > > ---
> > >  libavcodec/rawdec.c |    1 +
> > >  1 files changed, 1 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
> > > index 09089ec..9686d8e 100644
> > > --- a/libavcodec/rawdec.c
> > > +++ b/libavcodec/rawdec.c
> > > @@ -179,6 +179,7 @@ static int raw_decode(AVCodecContext *avctx,
> > >              }
> > >              linesize_align = 8;
> > >          } else {
> > > +            /* assume avctx->bits_per_coded_sample == 2 */
> > 
> > why not av_assert ?
> > this way the assumptation would be checked too
> 
> Updated.
> -- 
> FFmpeg = Fantastic and Free Meaningless Philosophical Experimenting Generator

>  rawdec.c |    2 ++
>  1 file changed, 2 insertions(+)
> 460e35f4173307c8801f42822fc63a1454cfdd49  0004-lavc-rawdec-add-assertion-check-in-raw_decode.patch
> From 75448ac180eecbe7eaca322bad722d405974fe0a Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefasab at gmail.com>
> Date: Mon, 25 Jun 2012 18:56:46 +0200
> Subject: [PATCH] lavc/rawdec: add assertion check in raw_decode()
> 
> Check on an implicit assumption done on the number of coded bits for
> paletted rawvideo with coded bits == 2.

LGTM

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- 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-devel/attachments/20120701/6ff0176b/attachment.asc>


More information about the ffmpeg-devel mailing list