On Wed, Feb 11, 2015 at 07:20:51PM +0530, Himangi Saraogi wrote:
> On 11 February 2015 at 18:03, Diego Biurrun <[email protected]> wrote:
> > On Wed, Feb 11, 2015 at 03:05:23AM +0530, Himangi Saraogi wrote:
> > > --- a/libavcodec/vp56.c
> > > +++ b/libavcodec/vp56.c
> > > @@ -530,20 +530,21 @@ int ff_vp56_decode_frame(AVCodecContext *avctx,
> > void *data, int *got_frame,
> > >                  av_frame_unref(s->frames[i]);
> > >              if (is_alpha) {
> > >                  ff_set_dimensions(avctx, 0, 0);
> > > -                return -1;
> > > +                return AVERROR_INVALIDDATA;
> > >              }
> > >          }
> > >
> > >          if (!is_alpha) {
> > > -            if (ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF) < 0) {
> > > +            int ret = ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF);
> > > +            if (ret < 0) {
> > >                  av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
> > > -                return -1;
> > > +                return ret;
> > >              }
> > >
> > >              if (res == VP56_SIZE_CHANGE)
> > >                  if (vp56_size_changed(avctx)) {
> > >                      av_frame_unref(p);
> > > -                    return -1;
> > > +                    return AVERROR_INVALIDDATA;
> > >                  }
> > >          }
> >
> > All of these functions return error codes, just propagate them.
> > Forwarding error codes is always better than making up your own.
> 
> Not quite sure how that can be done here as the errors are not really on
> return values.

I'm blind, it's just vp56_size_changed(), but for that function you can
save the return value and propagate it.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to