Tomas Härdin:
> tor 2022-10-06 klockan 21:45 +1100 skrev Peter Ross:
>>
>> +static av_cold int vqc_decode_init(AVCodecContext * avctx)
>> +{
>> + static AVOnce init_static_once = AV_ONCE_INIT;
>> + VqcContext *s = avctx->priv_data;
>> +
>> + s->vectors = av_malloc((avctx->width * avctx->height * 3) / 2);
>> + if (!s->vectors)
>> + return AVERROR(ENOMEM);
>> +
>> + s->coeff = av_malloc(2 * avctx->width * sizeof(int16_t));
>> + if (!s->coeff)
>> + return AVERROR(ENOMEM);
>> +
>> + s->tmp1 = av_malloc(avctx->width * sizeof(int16_t) / 2);
>> + if (!s->tmp1)
>> + return AVERROR(ENOMEM);
>> +
>> + s->tmp2 = av_malloc(avctx->width * sizeof(int16_t) / 2);
>
> av_malloc_array() perhaps? Not that these are likely to overflow since
> max pixels is usually far away from INT_MAX
>
Actually, sizeof(int16_t) is guaranteed to be two, so that
sizeof(int16_t) / 2 is always one.
- Andreas
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".