[FFmpeg-devel] [PATCH] add prores bitstream demuxer and muxer
James Almer
jamrial at gmail.com
Mon Jul 24 18:29:26 EEST 2023
On 7/24/2023 12:25 PM, Tomas Härdin wrote:
>> +static int prores_check_frame_header(const uint8_t *buf, const int
>> data_size)
>> +{
>> + int hdr_size, width, height;
>> + int version, alpha_info;
>> +
>> + hdr_size = AV_RB16(buf);
>> + if (hdr_size < 20)
>> + return AVERROR_INVALIDDATA;
>> +
>> + version = buf[3];
>> + if (version > 1)
>> + return AVERROR_INVALIDDATA;
>> +
>> + width = AV_RB16(buf + 8);
>> + height = AV_RB16(buf + 10);
>> + if (!width || !height)
>> + return AVERROR_INVALIDDATA;
>
> av_image_check_size2(). Also is this not already checked elsewhere?
This is for probing, so it's doing some basic bitstream checks to
prevent false positives. It's irrelevant if AVFrame can handle it or
not, as that'll be checked later.
That said, if Prores has an upper limit that's lower than 65535, then
that should be checked too and not just zero.
More information about the ffmpeg-devel
mailing list