On 8/30/20, Paul B Mahol <one...@gmail.com> wrote:
> On 8/30/20, Andreas Rheinhardt <andreas.rheinha...@gmail.com> wrote:
> [...]
>>> +static int read_hufftable(AVCodecContext *avctx, VLC *vlc)
>>> +{
>>> +    PhotoCDContext *s = avctx->priv_data;
>>> +    GetByteContext *gb = &s->gb;
>>> +    int start = s->streampos;
>>> +    int count, ret;
>>> +
>>> +    bytestream2_seek(gb, start, SEEK_SET);
>>> +
>>> +    count = bytestream2_get_byte(gb) + 1;
>>> +
>>
>> With this information you can check once whether there is enough data
>> left, allowing you to use the unchecked versions of the bytestream2 API.
>
> Fixed locally.
>
>>
>>> +    ff_free_vlc(vlc);
>>> +
>>> +    for (int j = 0; j < count; j++) {
>>> +        const int bit  = bytestream2_get_byte(gb) + 1;
>>> +        const int code = bytestream2_get_be16(gb) >> (16 - bit);
>>
>> You are using bit here before having validated it.
>
> Fixed locally.
>
> [...]
>


Gonna apply with few other small changes.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to