Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Malviya, Janpriya" <Janpriya_Malviya@bose.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: "Banerjee, Debasmit" <Debasmit_Banerjee@bose.com>,
	"Patel, Pratik" <Pratik_Patel@bose.com>,
	"Van Iderstine, David" <David_Van_Iderstine@bose.com>
Subject: Re: [FFmpeg-devel] [PATCH] libavformat/mov.c : Avoid seek request with invalid seek offset ( 9223372036854775799 ) after EOS
Date: Thu, 28 Apr 2022 13:43:41 +0000
Message-ID: <MWHPR08MB2655CCD5216D3B83299754CA80FD9@MWHPR08MB2655.namprd08.prod.outlook.com> (raw)
In-Reply-To: <tencent_0F109826EC67D16AB7D311DC678B98A62106@qq.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 4792 bytes --]

Hi Zhilizhao,

Thanks for help and support. I will test your all three patches with our setup when it get merged into master.

Regards
Janpriya.

From: "zhilizhao(ÕÔÖ¾Á¢)"<mailto:quinkblack@foxmail.com>
Sent: 26 April 2022 01:58 PM
To: FFmpeg development discussions and patches<mailto:ffmpeg-devel@ffmpeg.org>
Cc: Banerjee, Debasmit<mailto:Debasmit_Banerjee@bose.com>; Patel, Pratik<mailto:Pratik_Patel@bose.com>; Van Iderstine, David<mailto:David_Van_Iderstine@bose.com>
Subject: Re: [FFmpeg-devel] [PATCH] libavformat/mov.c : Avoid seek request with invalid seek offset ( 9223372036854775799 ) after EOS



> On Apr 22, 2022, at 4:37 PM, Malviya, Janpriya <Janpriya_Malviya@bose.com> wrote:
>
> Hello ffmpeg Dev team,
>
> While integrating FFmpeg for M4A , MP4 stream & facing issue that mov demuxer trying to request seek for invalid seek offset.
>
> Issue details:-
>        - Modified doc/examples/demuxing_decoding.c example to support Custom IO call-back because we have our  own mechanism to read data from source
>        -  In custom IO seek call back , we do not support ¡°whence¡± values AVSEEK_SIZE & SEEK_END , used to find stream size ( returning -1 in both the cases ).
>        - In attached screen shot , where we are observing seek with invalid seek offset and the seek requested after End of stream is detected
>        - Seek offset value 9223372036854775799 always the same ( I think INT64_MAX ¨C 8 ,  8 is length Atom type & size field )
>        - If we allow to return proper stream size in seek callback then this problem is not observed.

The real issue isn¡¯t about invalid seek offset, but use invalid box
size/type due to EOF.

Add another check just after the eof check in while condition isn¡¯t
efficient. I tried another method:

[1/3] avformat/mov: remove an always true condition
https://urldefense.com/v3/__http://ffmpeg.org/pipermail/ffmpeg-devel/2022-April/295712.html__;!!I6pijIezNA!y_KUjRpt0ie8shWRhndmGEosSUA0XTPqZLDL6wo1oiEcGS9zlqkjvgeW02KIZRriFN_4zSOSF55eUMBwYFpEi8BJ9_E$<https://urldefense.com/v3/__http:/ffmpeg.org/pipermail/ffmpeg-devel/2022-April/295712.html__;!!I6pijIezNA!y_KUjRpt0ie8shWRhndmGEosSUA0XTPqZLDL6wo1oiEcGS9zlqkjvgeW02KIZRriFN_4zSOSF55eUMBwYFpEi8BJ9_E$>

[2/3] reindent

[3/3] avformat/mov: fix use invalid box size/type due to eof
https://urldefense.com/v3/__http://ffmpeg.org/pipermail/ffmpeg-devel/2022-April/295713.html__;!!I6pijIezNA!y_KUjRpt0ie8shWRhndmGEosSUA0XTPqZLDL6wo1oiEcGS9zlqkjvgeW02KIZRriFN_4zSOSF55eUMBwYFpE8kolcu0$<https://urldefense.com/v3/__http:/ffmpeg.org/pipermail/ffmpeg-devel/2022-April/295713.html__;!!I6pijIezNA!y_KUjRpt0ie8shWRhndmGEosSUA0XTPqZLDL6wo1oiEcGS9zlqkjvgeW02KIZRriFN_4zSOSF55eUMBwYFpE8kolcu0$>

>
> Fix :
> In attached patch to verify EOS condition before going to parse atom data.
>
> Signed-off-by: Janpriya Malviya <Janpriya_Malviya@bose.com>
> ---
> libavformat/mov.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 6c847de..9704550 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -7556,6 +7556,10 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>         if (atom.size >= 8) {
>             a.size = avio_rb32(pb);
>             a.type = avio_rl32(pb);
> +
> +            if(avio_feof(pb))
> +                continue;
> +
>             if (((a.type == MKTAG('f','r','e','e') && c->moov_retry) ||
>                   a.type == MKTAG('h','o','o','v')) &&
>                 a.size >= 8 &&
> --
> 2.7.4
>
> <issueImage.png><reproduce_issue.c>_______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://urldefense.com/v3/__https://ffmpeg.org/mailman/listinfo/ffmpeg-devel__;!!I6pijIezNA!y_KUjRpt0ie8shWRhndmGEosSUA0XTPqZLDL6wo1oiEcGS9zlqkjvgeW02KIZRriFN_4zSOSF55eUMBwYFpE04pB2pw$<https://urldefense.com/v3/__https:/ffmpeg.org/mailman/listinfo/ffmpeg-devel__;!!I6pijIezNA!y_KUjRpt0ie8shWRhndmGEosSUA0XTPqZLDL6wo1oiEcGS9zlqkjvgeW02KIZRriFN_4zSOSF55eUMBwYFpE04pB2pw$>
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://urldefense.com/v3/__https://ffmpeg.org/mailman/listinfo/ffmpeg-devel__;!!I6pijIezNA!y_KUjRpt0ie8shWRhndmGEosSUA0XTPqZLDL6wo1oiEcGS9zlqkjvgeW02KIZRriFN_4zSOSF55eUMBwYFpE04pB2pw$<https://urldefense.com/v3/__https:/ffmpeg.org/mailman/listinfo/ffmpeg-devel__;!!I6pijIezNA!y_KUjRpt0ie8shWRhndmGEosSUA0XTPqZLDL6wo1oiEcGS9zlqkjvgeW02KIZRriFN_4zSOSF55eUMBwYFpE04pB2pw$>

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


[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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-04-28 13:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22  8:37 Malviya, Janpriya
2022-04-26  3:09 ` Malviya, Janpriya
2022-04-26  8:28 ` "zhilizhao(赵志立)"
2022-04-28 13:43   ` Malviya, Janpriya [this message]
2022-05-01 17:00   ` Malviya, Janpriya

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=MWHPR08MB2655CCD5216D3B83299754CA80FD9@MWHPR08MB2655.namprd08.prod.outlook.com \
    --to=janpriya_malviya@bose.com \
    --cc=David_Van_Iderstine@bose.com \
    --cc=Debasmit_Banerjee@bose.com \
    --cc=Pratik_Patel@bose.com \
    --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