From: Kieran Kunhya via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: "Martin Storsjö" <martin@martin.st>
Cc: Kieran Kunhya <kieran618@googlemail.com>,
Kieran Kunhya via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] checkasm/v210enc.c: Use checkasm_check_type
Date: Mon, 10 Feb 2025 12:56:04 +0000
Message-ID: <CABGuwEn=pRUzpSCSHA1tpwqS_JAULnNz9dY5L69OTyMqsuS5+w@mail.gmail.com> (raw)
In-Reply-To: <9f99fb7-7218-e2d4-57fb-be187149cefa@martin.st>
On Mon, Feb 10, 2025 at 12:40 PM Martin Storsjö <martin@martin.st> wrote:
>
> On Sat, 8 Feb 2025, Kieran Kunhya via ffmpeg-devel wrote:
>
> > $subj
>
> > - if (memcmp(y0, y1, BUF_SIZE * sizeof(type)) \
> > - || memcmp(u0, u1, BUF_SIZE * sizeof(type) / 2) \
> > - || memcmp(v0, v1, BUF_SIZE * sizeof(type) / 2) \
> > - || memcmp(dst0, dst1, width * 8 / 3)) \
> > + if (checkasm_check_##type(NULL, 0, y0, 0, y1, 0, BUF_SIZE, 0, NULL) \
> > + || checkasm_check_##type(NULL, 0, u0, 0, u1, 0, BUF_SIZE / 2, 0, NULL) \
> > + || checkasm_check_##type(NULL, 0, v0, 0, v1, 0, BUF_SIZE / 2, 0, NULL) \
> > + || checkasm_check_uint8_t(NULL, 0, dst0, 0, dst1, 0, (width * 8 / 3), 0, NULL)) \
>
> This actually doesn't detect any failures at all; you're passing it
> parameters for checking a buffer of BUF_SIZE width and 0 height, so it
> doesn't check anything.
>
> By passing height 1, it does seem to work as intended (detecting an
> intentionally added error in the asm).
>
> It feels a little bit unwieldy to check (and print out, if checkasm is run
> with "-v") the whole BUF_SIZE, but it's good to have testing for potential
> writes out of bounds at least, like before.
>
> Further in dav1d there are more improvements to these checkasm helpers,
> which we haven't backported to ffmpeg yet, that helps with allocating
> padded buffers and checking that the padding isn't overwritten; that would
> allow reducing the size of the checked area, to make it easier to read on
> errors too.
>
> But until that's backported, I guess this is fine, if you change the
> height to 1.
>
> // Martin
>
Sorry yes I had that fixed locally. I also noticed it was a lot of
data to print the whole BUF_SIZE.
Kieran
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
prev parent reply other threads:[~2025-02-10 12:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-08 16:47 Kieran Kunhya via ffmpeg-devel
2025-02-10 12:40 ` Martin Storsjö
2025-02-10 12:56 ` Kieran Kunhya via ffmpeg-devel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CABGuwEn=pRUzpSCSHA1tpwqS_JAULnNz9dY5L69OTyMqsuS5+w@mail.gmail.com' \
--to=ffmpeg-devel@ffmpeg.org \
--cc=kieran618@googlemail.com \
--cc=martin@martin.st \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git