On Sun, 3 Aug 2014 11:09:11 +0100, Vittorio Giovara <[email protected]> wrote: > On Sun, Aug 3, 2014 at 1:24 AM, Luca Barbato <[email protected]> wrote: > > On 03/08/14 02:17, Vittorio Giovara wrote: > >> buf += 2; /// skipping 2 unneeded bytes > >> - bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE); > >> + > >> + if (buf_size > CDG_HEADER_SIZE) > >> + bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE); > > > > > > Looks incomplete. The condition seems always invalid and should reported > > to the user. > > I think that gets checked by the block above > > if (buf_size < CDG_MINIMUM_PKT_SIZE) { > av_log(avctx, AV_LOG_ERROR, "buffer too small for decoder\n"); > return AVERROR(EINVAL); > } > > CDG_MINIMUM_PKT_SIZE is 6 and CDG_HEADER_SIZE is 8 and buf_size > doesn't seem to get updated.
The point here is that in case of error we should not just continue as if nothing has happened. -- Anton Khirnov _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
