On Thu, Aug 1, 2013 at 2:50 PM, Diego Biurrun <[email protected]> wrote:
> On Tue, Jul 30, 2013 at 06:25:42PM +0200, Vittorio Giovara wrote:
> > --- a/libavcodec/h264_sei.c
> > +++ b/libavcodec/h264_sei.c
> > @@ -168,6 +168,7 @@ int ff_h264_decode_sei(H264Context *h)
> > while (get_bits_left(&h->gb) > 16) {
> > int size = 0;
> > int type = 0;
> > + int ret = 0;
> >
> > do {
> > type += show_bits(&h->gb, 8);
> > @@ -179,24 +180,22 @@ int ff_h264_decode_sei(H264Context *h)
> >
> > switch (type) {
> > case SEI_TYPE_PIC_TIMING: // Picture timing SEI
> > - if (decode_picture_timing(h) < 0)
> > - return -1;
> > + ret = decode_picture_timing(h);
> > break;
> > case SEI_TYPE_USER_DATA_UNREGISTERED:
> > - if (decode_unregistered_user_data(h, size) < 0)
> > - return -1;
> > + ret = decode_unregistered_user_data(h, size);
> > break;
> > case SEI_TYPE_RECOVERY_POINT:
> > - if (decode_recovery_point(h) < 0)
> > - return -1;
> > + ret = decode_recovery_point(h);
> > break;
> > case SEI_BUFFERING_PERIOD:
> > - if (decode_buffering_period(h) < 0)
> > - return -1;
> > + ret = decode_buffering_period(h);
> > break;
> > default:
> > skip_bits(&h->gb, 8 * size);
> > }
> > + if (ret < 0)
> > + return ret;
>
> I would suggest returning from the case blocks directly. To me that
> is more straightforward than skipping over the switch and returning
> from there.
>
Amended locally.
Any other comments?
Vittorio
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel