Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Chris Ribble <chris.ribble@resi.io>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] Revert "avformat/mov: disallow a zero sample size in trun atoms"
Date: Sun, 4 Dec 2022 19:38:23 -0600
Message-ID: <CANAqhSa7xGUs22uFwXdqw0sAuYu9=W_HWGTxOFya9HNXRZ8UBQ@mail.gmail.com> (raw)
In-Reply-To: <df96ee82-5de8-c0ff-c4a-3df6ce6df8fe@passwd.hu>

> More strict enforcement of sample size was introduced to avoid DOS/Timeout
> with crafted (fuzzed) files and disallow emitting zero sized packets.
>
> Invalid file support is not something that is always worth doing, there
> are other, more important factors, like limiting code complexity or
> improving resiliance against denial of service. The problem here is that I
> honestly don't know if a zero sample size is against spec, just stupid, or
> there is a legitimate use for it.
>
> So I sent a 2 patch series which fixes the original issue differently.
> Please test and review them if you can.

Marton,

Thank you for looking into this further.

I tried your patch series and FFmpeg still generates an error
(AVERROR_INVALIDDATA) while processing the moof fragment with
zero-sized samples.

It seems like !(flags & MOV_TRUN_SAMPLE_SIZE) evaluates to true when
the flag is set (512 is "inverted" to 1). Is that what you had in
mind?

If I change it to this, things work as expected for my input mp4:
if (entries && !frag->size && (flags & MOV_TRUN_SAMPLE_SIZE !=
MOV_TRUN_SAMPLE_SIZE))
  return AVERROR_INVALIDDATA;

Sorry if I was supposed to provide this feedback on the patch series
itself; I'm happy to do so there as needed.

Thanks,
Chris
_______________________________________________
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".

  reply	other threads:[~2022-12-05  1:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01 21:40 Chris Ribble
2022-12-01 22:51 ` Marton Balint
2022-12-02  0:46   ` Chris Ribble
2022-12-02  4:11     ` Gyan Doshi
2022-12-05  0:16       ` Marton Balint
2022-12-05  1:38         ` Chris Ribble [this message]
2022-12-05 18:04           ` Marton Balint
2022-12-06  7:28             ` Chris Ribble
2022-12-11 11:53               ` Marton Balint

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='CANAqhSa7xGUs22uFwXdqw0sAuYu9=W_HWGTxOFya9HNXRZ8UBQ@mail.gmail.com' \
    --to=chris.ribble@resi.io \
    --cc=ffmpeg-devel@ffmpeg.org \
    /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