[FFmpeg-devel] 回复: [PATCH v2] add prores bitstream demuxer and muxer

hung kuishing hungkuishing at outlook.com
Tue Jul 25 15:40:43 EEST 2023


Hi, width and height use u(16) descriptor in prores specification, and spec does not limit scope, 
I guess 1~65535 are allowable. So I think I'll change it to check if they are equal to 0.
What do you propose?

-----邮件原件-----
发件人: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> 代表 Tomas H?rdin
发送时间: 2023年7月25日 19:48
收件人: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
主题: Re: [FFmpeg-devel] [PATCH v2] add prores bitstream demuxer and muxer

> +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 < FRAME_FIXED_HEADER_SIZE)
> +        return AVERROR_INVALIDDATA;
> +
> +    version = buf[3];
> +    if (version > 1)
> +        return AVERROR_INVALIDDATA;
> +
> +    width  = AV_RB16(buf + 8);
> +    height = AV_RB16(buf + 10);
> +    if (width < 16 || height < 16)

As others pointed out, is there a maximum width or height also, or perhaps a maximum width*height?

/Tomas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel at ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


More information about the ffmpeg-devel mailing list