On Fri, Feb 20, 2015 at 12:11:10PM +0200, Martin Storsjö wrote:
> On Thu, 19 Feb 2015, Diego Biurrun wrote:
> >On Thu, Feb 19, 2015 at 10:34:03PM +0200, Martin Storsjö wrote:
> >>The if statement just above checks the same, so there's no possibility
> >>that src_len ends up negative.
> >
> >I agree about the if-statement, but it seems src_len can end up negative.
> >Here's a shortened version of the block:
> >
> >   while (src_len > 2) {
> >       uint16_t nal_size = AV_RB16(src);
> >       src_len -= 2;
> >       src_len -= nal_size;
> >       if (src_len < 0)
> >           av_log(ctx, AV_LOG_ERROR,
> >                  "Consumed more bytes than we got! (%d)\n", src_len);
> >
> >Looks like src_len can end up negative to me ...
> 
> Oh, right.
> 
> So, fine if I change the commit message like this?
> 
> ---
> rtpdec_h264: Remove an unnecessary check
> 
> If src_len is too small for nal_size, we already print a warning above, and
> the next step is to check the while loop condition anyway, so this one
> serves no purpose.

I'm fine with that or even a much more terse version, but we shouldn't
make any false claims in the log message :)

Diego
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to