[FFmpeg-devel] [PATCH 1/2] xxan: make code independent of sizeof(AVFrame)

Michael Niedermayer michaelni at gmx.at
Mon Mar 25 17:35:01 CET 2013


On Mon, Mar 25, 2013 at 02:17:20PM +0000, Paul B Mahol wrote:
> On 3/24/13, Michael Niedermayer <michaelni at gmx.at> wrote:
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  libavcodec/xxan.c |   54
> > ++++++++++++++++++++++++++++++-----------------------
> >  1 file changed, 31 insertions(+), 23 deletions(-)
> >
> > diff --git a/libavcodec/xxan.c b/libavcodec/xxan.c
> > index e2b1b8c..9429eb9 100644
> > --- a/libavcodec/xxan.c
> > +++ b/libavcodec/xxan.c
> > @@ -30,7 +30,7 @@
> >
> >  typedef struct XanContext {
> >      AVCodecContext *avctx;
> > -    AVFrame pic;
> > +    AVFrame *pic;
> >
> >      uint8_t *y_buffer;
> >      uint8_t *scratch_buffer;
> > @@ -38,6 +38,8 @@ typedef struct XanContext {
> >      GetByteContext gb;
> >  } XanContext;
> >
> > +static av_cold int xan_decode_end(AVCodecContext *avctx);
> > +
> >  static av_cold int xan_decode_init(AVCodecContext *avctx)
> >  {
> >      XanContext *s = avctx->priv_data;
> > @@ -57,7 +59,13 @@ static av_cold int xan_decode_init(AVCodecContext
> > *avctx)
> >          return AVERROR(ENOMEM);
> >      s->scratch_buffer = av_malloc(s->buffer_size + 130);
> >      if (!s->scratch_buffer) {
> > -        av_freep(&s->y_buffer);
> > +        xan_decode_end(avctx);
> > +        return AVERROR(ENOMEM);
> > +    }
> > +
> > +    s->pic = av_frame_alloc();
> > +    if(!s->pic) {
> 
> space between 'if' and '('

fixed

[...]
> 
> rest lgtm

applied

thanks

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

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- 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/20130325/14971a82/attachment.asc>


More information about the ffmpeg-devel mailing list