Quoting Diego Biurrun (2015-04-11 14:55:37)
> On Sat, Apr 11, 2015 at 02:45:56PM +0200, Anton Khirnov wrote:
> > Quoting Diego Biurrun (2015-04-11 11:00:51)
> > > On Sat, Apr 11, 2015 at 02:11:06AM +0530, Himangi Saraogi wrote:
> > > > --- a/libavformat/rtmppkt.c
> > > > +++ b/libavformat/rtmppkt.c
> > > > @@ -538,7 +538,8 @@ static const char* rtmp_packet_type(int type)
> > > >  static void amf_tag_contents(void *ctx, const uint8_t *data,
> > > >                               const uint8_t *data_end)
> > > >  {
> > > > -    unsigned int size, nb = -1;
> > > > +    unsigned int size;
> > > > +    uint32_t nb = UINT32_MAX;
> > > 
> > > This is not correct, nb is assigned the return value from
> > > bystream_get_be32(), which is unsigned int.
> > 
> > Stab. bytestream_get_be32 will obviously be at most 32bit.
> 
> Stab back.  It returns unsigned int, so that's the proper type for
> variables capturing its return (type).  Yes, one could argue that
> it should return uint32_t instead.

No, not really. The type it returns might be a plain unsigned, but the
function semantics guarantee the returned value is 32bit, so uint32_t is
perfectly appropriate.

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

Reply via email to