diff mbox series

[FFmpeg-devel] track id could be zore

Message ID tencent_549B16B09A750FDF6E57851F128DEDB5BE07@qq.com
State New
Headers show
Series [FFmpeg-devel] track id could be zore | expand

Checks

Context Check Description
andriy/configure_x86 warning Failed to apply patch

Commit Message

帝江-VII Aug. 12, 2022, 7:26 a.m. UTC
Signed-off-by: yunfei.li <1195878682@qq.com&gt;
---
&nbsp;libavformat/mov.c | 2 --
&nbsp;1 file changed, 2 deletions(-)


--&nbsp;
2.35.1.windows.2

Comments

Derek Buitenhuis Aug. 12, 2022, 3 p.m. UTC | #1
On 8/12/2022 8:26 AM, 帝江-VII wrote:
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 6ee6ed0950..3b0c328e6a 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -4916,8 +4916,6 @@ static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
> &nbsp; &nbsp; &nbsp;flags = avio_rb24(pb);
> &nbsp;
> &nbsp; &nbsp; &nbsp;track_id = avio_rb32(pb);
> -&nbsp; &nbsp; if (!track_id)
> -&nbsp; &nbsp; &nbsp; &nbsp; return AVERROR_INVALIDDATA;


Bad patch formatting, aside, no, it cannot. Zero is not a
valid track ID.

- Derek
diff mbox series

Patch

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 6ee6ed0950..3b0c328e6a 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4916,8 +4916,6 @@  static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
&nbsp; &nbsp; &nbsp;flags = avio_rb24(pb);
&nbsp;
&nbsp; &nbsp; &nbsp;track_id = avio_rb32(pb);
-&nbsp; &nbsp; if (!track_id)
-&nbsp; &nbsp; &nbsp; &nbsp; return AVERROR_INVALIDDATA;
&nbsp; &nbsp; &nbsp;for (i = 0; i < c-&gt;trex_count; i++)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (c-&gt;trex_data[i].track_id == track_id) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;trex = &amp;c-&gt;trex_data[i];