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.
-- 
Vittorio
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to