* [FFmpeg-devel] [PATCH 1/2] tools/target_dec_fuzzer: Adjust threshold or CFHD @ 2022-04-29 22:18 Michael Niedermayer 2022-04-29 22:18 ` [FFmpeg-devel] [PATCH 2/2] avcodec/h2645_parse: Check HEVC NAL size Michael Niedermayer 0 siblings, 1 reply; 6+ messages in thread From: Michael Niedermayer @ 2022-04-29 22:18 UTC (permalink / raw) To: FFmpeg development discussions and patches Fixes: Timeout Fixes: 46504/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-6376835606249472 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- tools/target_dec_fuzzer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c index 288aa63313..7258c76c84 100644 --- a/tools/target_dec_fuzzer.c +++ b/tools/target_dec_fuzzer.c @@ -157,7 +157,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { case AV_CODEC_ID_AGM: maxpixels /= 1024; break; case AV_CODEC_ID_ARBC: maxpixels /= 1024; break; case AV_CODEC_ID_BINKVIDEO: maxpixels /= 32; break; - case AV_CODEC_ID_CFHD: maxpixels /= 128; break; + case AV_CODEC_ID_CFHD: maxpixels /= 4096; break; case AV_CODEC_ID_COOK: maxsamples /= 1<<20; break; case AV_CODEC_ID_DFA: maxpixels /= 1024; break; case AV_CODEC_ID_DIRAC: maxpixels /= 8192; break; -- 2.17.1 _______________________________________________ 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". ^ permalink raw reply [flat|nested] 6+ messages in thread
* [FFmpeg-devel] [PATCH 2/2] avcodec/h2645_parse: Check HEVC NAL size 2022-04-29 22:18 [FFmpeg-devel] [PATCH 1/2] tools/target_dec_fuzzer: Adjust threshold or CFHD Michael Niedermayer @ 2022-04-29 22:18 ` Michael Niedermayer 2022-04-30 9:35 ` Michael Niedermayer 2022-04-30 20:45 ` Andreas Rheinhardt 0 siblings, 2 replies; 6+ messages in thread From: Michael Niedermayer @ 2022-04-29 22:18 UTC (permalink / raw) To: FFmpeg development discussions and patches Fixes: Assertion failure Fixes: 46662/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-4947860854013952 This also results in more frames to be decoded from fate samples Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavcodec/h2645_parse.c | 2 +- .../ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 | 10 ++++++++++ tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c index 03780680c6..78ab22b76e 100644 --- a/libavcodec/h2645_parse.c +++ b/libavcodec/h2645_parse.c @@ -292,7 +292,7 @@ static int hevc_parse_nal_header(H2645NAL *nal, void *logctx) { GetBitContext *gb = &nal->gb; - if (get_bits1(gb) != 0) + if (get_bits_left(gb) < 16 || get_bits1(gb) != 0) return AVERROR_INVALIDDATA; nal->type = get_bits(gb, 6); diff --git a/tests/ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 b/tests/ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 index 0c930f6556..3283925e38 100644 --- a/tests/ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 +++ b/tests/ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 @@ -25,6 +25,16 @@ 0, 19, 19, 1, 599040, 0x4227009b 0, 20, 20, 1, 599040, 0x1bda8be4 0, 21, 21, 1, 599040, 0xd1d5dcb4 +0, 22, 22, 1, 599040, 0x58b2edb3 +0, 23, 23, 1, 599040, 0xd1f795d8 +0, 24, 24, 1, 599040, 0x3331d5e6 +0, 25, 25, 1, 599040, 0x5e5ec2c9 +0, 26, 26, 1, 599040, 0x3b907bf5 +0, 27, 27, 1, 599040, 0xefcbf471 +0, 28, 28, 1, 599040, 0x2769a578 +0, 29, 29, 1, 599040, 0x812ce986 +0, 30, 30, 1, 599040, 0xf07c212c +0, 31, 31, 1, 599040, 0xb5476890 0, 32, 32, 1, 599040, 0x00a0249f 0, 33, 33, 1, 599040, 0x7263f7cf 0, 34, 34, 1, 599040, 0x47054be4 diff --git a/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 b/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 index e661ff245e..776267b59c 100644 --- a/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 +++ b/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 @@ -70,6 +70,9 @@ 0, 64, 64, 1, 149760, 0x3362678b 0, 65, 65, 1, 149760, 0x6e7fc851 0, 66, 66, 1, 149760, 0x33f96449 +0, 67, 67, 1, 149760, 0xd9d05007 +0, 75, 75, 1, 149760, 0x477f2cf2 +0, 76, 76, 1, 149760, 0xe1f9ccd0 0, 77, 77, 1, 149760, 0xb3ba8cfb 0, 78, 78, 1, 149760, 0x64787995 0, 79, 79, 1, 149760, 0xc10de4c4 -- 2.17.1 _______________________________________________ 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". ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/2] avcodec/h2645_parse: Check HEVC NAL size 2022-04-29 22:18 ` [FFmpeg-devel] [PATCH 2/2] avcodec/h2645_parse: Check HEVC NAL size Michael Niedermayer @ 2022-04-30 9:35 ` Michael Niedermayer 2022-04-30 20:45 ` Andreas Rheinhardt 1 sibling, 0 replies; 6+ messages in thread From: Michael Niedermayer @ 2022-04-30 9:35 UTC (permalink / raw) To: FFmpeg development discussions and patches [-- Attachment #1.1: Type: text/plain, Size: 485 bytes --] On Sat, Apr 30, 2022 at 12:18:26AM +0200, Michael Niedermayer wrote: > Fixes: Assertion failure it was this av_assert1((get_bits_count(gb) % 8) == 0); that failed IIRC [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Rewriting code that is poorly written but fully understood is good. Rewriting code that one doesnt understand is a sign that one is less smart than the original author, trying to rewrite it will not make it better. [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 195 bytes --] [-- 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". ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/2] avcodec/h2645_parse: Check HEVC NAL size 2022-04-29 22:18 ` [FFmpeg-devel] [PATCH 2/2] avcodec/h2645_parse: Check HEVC NAL size Michael Niedermayer 2022-04-30 9:35 ` Michael Niedermayer @ 2022-04-30 20:45 ` Andreas Rheinhardt 2022-06-22 11:05 ` Andreas Rheinhardt 1 sibling, 1 reply; 6+ messages in thread From: Andreas Rheinhardt @ 2022-04-30 20:45 UTC (permalink / raw) To: ffmpeg-devel Michael Niedermayer: > Fixes: Assertion failure > Fixes: 46662/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-4947860854013952 > > This also results in more frames to be decoded from fate samples > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavcodec/h2645_parse.c | 2 +- > .../ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 | 10 ++++++++++ > tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 | 3 +++ > 3 files changed, 14 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c > index 03780680c6..78ab22b76e 100644 > --- a/libavcodec/h2645_parse.c > +++ b/libavcodec/h2645_parse.c > @@ -292,7 +292,7 @@ static int hevc_parse_nal_header(H2645NAL *nal, void *logctx) > { > GetBitContext *gb = &nal->gb; > > - if (get_bits1(gb) != 0) > + if (get_bits_left(gb) < 16 || get_bits1(gb) != 0) > return AVERROR_INVALIDDATA; > > nal->type = get_bits(gb, 6); > diff --git a/tests/ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 b/tests/ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 > index 0c930f6556..3283925e38 100644 > --- a/tests/ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 > +++ b/tests/ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 > @@ -25,6 +25,16 @@ > 0, 19, 19, 1, 599040, 0x4227009b > 0, 20, 20, 1, 599040, 0x1bda8be4 > 0, 21, 21, 1, 599040, 0xd1d5dcb4 > +0, 22, 22, 1, 599040, 0x58b2edb3 > +0, 23, 23, 1, 599040, 0xd1f795d8 > +0, 24, 24, 1, 599040, 0x3331d5e6 > +0, 25, 25, 1, 599040, 0x5e5ec2c9 > +0, 26, 26, 1, 599040, 0x3b907bf5 > +0, 27, 27, 1, 599040, 0xefcbf471 > +0, 28, 28, 1, 599040, 0x2769a578 > +0, 29, 29, 1, 599040, 0x812ce986 > +0, 30, 30, 1, 599040, 0xf07c212c > +0, 31, 31, 1, 599040, 0xb5476890 > 0, 32, 32, 1, 599040, 0x00a0249f > 0, 33, 33, 1, 599040, 0x7263f7cf > 0, 34, 34, 1, 599040, 0x47054be4 > diff --git a/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 b/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 > index e661ff245e..776267b59c 100644 > --- a/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 > +++ b/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 > @@ -70,6 +70,9 @@ > 0, 64, 64, 1, 149760, 0x3362678b > 0, 65, 65, 1, 149760, 0x6e7fc851 > 0, 66, 66, 1, 149760, 0x33f96449 > +0, 67, 67, 1, 149760, 0xd9d05007 > +0, 75, 75, 1, 149760, 0x477f2cf2 > +0, 76, 76, 1, 149760, 0xe1f9ccd0 > 0, 77, 77, 1, 149760, 0xb3ba8cfb > 0, 78, 78, 1, 149760, 0x64787995 > 0, 79, 79, 1, 149760, 0xc10de4c4 get_bit_length currently presumes every NALU to contain rbsp_trailing_bits. Yet this is not true for the End of Sequence/Bitstream units which are just headers without RBSP. For these units, get_bit_length might truncate them -- it does so for end of sequence units in H.264. It would not be a serious issue for H.265, as the semantics of nuh_temporal_id_plus1 require nuh_temporal_id_plus1 to be 1 for End of Sequence/Bitstream units. Nevertheless I think this should be coupled with a patch that does not truncate the NAL unit if it is just a header. - Andreas _______________________________________________ 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". ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/2] avcodec/h2645_parse: Check HEVC NAL size 2022-04-30 20:45 ` Andreas Rheinhardt @ 2022-06-22 11:05 ` Andreas Rheinhardt 2022-06-24 0:03 ` Michael Niedermayer 0 siblings, 1 reply; 6+ messages in thread From: Andreas Rheinhardt @ 2022-06-22 11:05 UTC (permalink / raw) To: ffmpeg-devel Andreas Rheinhardt: > Michael Niedermayer: >> Fixes: Assertion failure >> Fixes: 46662/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-4947860854013952 >> >> This also results in more frames to be decoded from fate samples >> >> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg >> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> >> --- >> libavcodec/h2645_parse.c | 2 +- >> .../ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 | 10 ++++++++++ >> tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 | 3 +++ >> 3 files changed, 14 insertions(+), 1 deletion(-) >> >> diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c >> index 03780680c6..78ab22b76e 100644 >> --- a/libavcodec/h2645_parse.c >> +++ b/libavcodec/h2645_parse.c >> @@ -292,7 +292,7 @@ static int hevc_parse_nal_header(H2645NAL *nal, void *logctx) >> { >> GetBitContext *gb = &nal->gb; >> >> - if (get_bits1(gb) != 0) >> + if (get_bits_left(gb) < 16 || get_bits1(gb) != 0) >> return AVERROR_INVALIDDATA; >> >> nal->type = get_bits(gb, 6); >> diff --git a/tests/ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 b/tests/ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 >> index 0c930f6556..3283925e38 100644 >> --- a/tests/ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 >> +++ b/tests/ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 >> @@ -25,6 +25,16 @@ >> 0, 19, 19, 1, 599040, 0x4227009b >> 0, 20, 20, 1, 599040, 0x1bda8be4 >> 0, 21, 21, 1, 599040, 0xd1d5dcb4 >> +0, 22, 22, 1, 599040, 0x58b2edb3 >> +0, 23, 23, 1, 599040, 0xd1f795d8 >> +0, 24, 24, 1, 599040, 0x3331d5e6 >> +0, 25, 25, 1, 599040, 0x5e5ec2c9 >> +0, 26, 26, 1, 599040, 0x3b907bf5 >> +0, 27, 27, 1, 599040, 0xefcbf471 >> +0, 28, 28, 1, 599040, 0x2769a578 >> +0, 29, 29, 1, 599040, 0x812ce986 >> +0, 30, 30, 1, 599040, 0xf07c212c >> +0, 31, 31, 1, 599040, 0xb5476890 >> 0, 32, 32, 1, 599040, 0x00a0249f >> 0, 33, 33, 1, 599040, 0x7263f7cf >> 0, 34, 34, 1, 599040, 0x47054be4 >> diff --git a/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 b/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 >> index e661ff245e..776267b59c 100644 >> --- a/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 >> +++ b/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 >> @@ -70,6 +70,9 @@ >> 0, 64, 64, 1, 149760, 0x3362678b >> 0, 65, 65, 1, 149760, 0x6e7fc851 >> 0, 66, 66, 1, 149760, 0x33f96449 >> +0, 67, 67, 1, 149760, 0xd9d05007 >> +0, 75, 75, 1, 149760, 0x477f2cf2 >> +0, 76, 76, 1, 149760, 0xe1f9ccd0 >> 0, 77, 77, 1, 149760, 0xb3ba8cfb >> 0, 78, 78, 1, 149760, 0x64787995 >> 0, 79, 79, 1, 149760, 0xc10de4c4 > > get_bit_length currently presumes every NALU to contain > rbsp_trailing_bits. Yet this is not true for the End of > Sequence/Bitstream units which are just headers without RBSP. For these > units, get_bit_length might truncate them -- it does so for end of > sequence units in H.264. It would not be a serious issue for H.265, as > the semantics of nuh_temporal_id_plus1 require nuh_temporal_id_plus1 to > be 1 for End of Sequence/Bitstream units. Nevertheless I think this > should be coupled with a patch that does not truncate the NAL unit if it > is just a header. > 1. I just sent a patch implementing the above: https://ffmpeg.org/pipermail/ffmpeg-devel/2022-June/297923.html Please confirm that it actually fixes the testcase its commit message claims to fix. 2. The RAP_B_Bossen_1 and NoOutPrior_A_Qualcomm_1 (where the testcases change due to your patch) contain completely fine end of sequence NALUs. Because they are valid, stripping them (as your patch does) is not ok (e.g. these units would even be discarded when using hevc_metadata). There are two bugs with these units: a) Our parser puts them at the beginning of their NALUs, yet they should be at the end of the (preceding) NALU. b) When remuxing the samples to Matroska with mkvmerge (which puts these units at the end of their packets), the output is the same as with raw input, i.e. decoder still misses some frames. So somehow these units confuse the decoder. - Andreas _______________________________________________ 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". ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/2] avcodec/h2645_parse: Check HEVC NAL size 2022-06-22 11:05 ` Andreas Rheinhardt @ 2022-06-24 0:03 ` Michael Niedermayer 0 siblings, 0 replies; 6+ messages in thread From: Michael Niedermayer @ 2022-06-24 0:03 UTC (permalink / raw) To: FFmpeg development discussions and patches [-- Attachment #1.1: Type: text/plain, Size: 5471 bytes --] On Wed, Jun 22, 2022 at 01:05:22PM +0200, Andreas Rheinhardt wrote: > Andreas Rheinhardt: > > Michael Niedermayer: > >> Fixes: Assertion failure > >> Fixes: 46662/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-4947860854013952 > >> > >> This also results in more frames to be decoded from fate samples > >> > >> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > >> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > >> --- > >> libavcodec/h2645_parse.c | 2 +- > >> .../ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 | 10 ++++++++++ > >> tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 | 3 +++ > >> 3 files changed, 14 insertions(+), 1 deletion(-) > >> > >> diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c > >> index 03780680c6..78ab22b76e 100644 > >> --- a/libavcodec/h2645_parse.c > >> +++ b/libavcodec/h2645_parse.c > >> @@ -292,7 +292,7 @@ static int hevc_parse_nal_header(H2645NAL *nal, void *logctx) > >> { > >> GetBitContext *gb = &nal->gb; > >> > >> - if (get_bits1(gb) != 0) > >> + if (get_bits_left(gb) < 16 || get_bits1(gb) != 0) > >> return AVERROR_INVALIDDATA; > >> > >> nal->type = get_bits(gb, 6); > >> diff --git a/tests/ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 b/tests/ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 > >> index 0c930f6556..3283925e38 100644 > >> --- a/tests/ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 > >> +++ b/tests/ref/fate/hevc-conformance-NoOutPrior_A_Qualcomm_1 > >> @@ -25,6 +25,16 @@ > >> 0, 19, 19, 1, 599040, 0x4227009b > >> 0, 20, 20, 1, 599040, 0x1bda8be4 > >> 0, 21, 21, 1, 599040, 0xd1d5dcb4 > >> +0, 22, 22, 1, 599040, 0x58b2edb3 > >> +0, 23, 23, 1, 599040, 0xd1f795d8 > >> +0, 24, 24, 1, 599040, 0x3331d5e6 > >> +0, 25, 25, 1, 599040, 0x5e5ec2c9 > >> +0, 26, 26, 1, 599040, 0x3b907bf5 > >> +0, 27, 27, 1, 599040, 0xefcbf471 > >> +0, 28, 28, 1, 599040, 0x2769a578 > >> +0, 29, 29, 1, 599040, 0x812ce986 > >> +0, 30, 30, 1, 599040, 0xf07c212c > >> +0, 31, 31, 1, 599040, 0xb5476890 > >> 0, 32, 32, 1, 599040, 0x00a0249f > >> 0, 33, 33, 1, 599040, 0x7263f7cf > >> 0, 34, 34, 1, 599040, 0x47054be4 > >> diff --git a/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 b/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 > >> index e661ff245e..776267b59c 100644 > >> --- a/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 > >> +++ b/tests/ref/fate/hevc-conformance-RAP_B_Bossen_1 > >> @@ -70,6 +70,9 @@ > >> 0, 64, 64, 1, 149760, 0x3362678b > >> 0, 65, 65, 1, 149760, 0x6e7fc851 > >> 0, 66, 66, 1, 149760, 0x33f96449 > >> +0, 67, 67, 1, 149760, 0xd9d05007 > >> +0, 75, 75, 1, 149760, 0x477f2cf2 > >> +0, 76, 76, 1, 149760, 0xe1f9ccd0 > >> 0, 77, 77, 1, 149760, 0xb3ba8cfb > >> 0, 78, 78, 1, 149760, 0x64787995 > >> 0, 79, 79, 1, 149760, 0xc10de4c4 > > > > get_bit_length currently presumes every NALU to contain > > rbsp_trailing_bits. Yet this is not true for the End of > > Sequence/Bitstream units which are just headers without RBSP. For these > > units, get_bit_length might truncate them -- it does so for end of > > sequence units in H.264. It would not be a serious issue for H.265, as > > the semantics of nuh_temporal_id_plus1 require nuh_temporal_id_plus1 to > > be 1 for End of Sequence/Bitstream units. Nevertheless I think this > > should be coupled with a patch that does not truncate the NAL unit if it > > is just a header. > > > > 1. I just sent a patch implementing the above: > https://ffmpeg.org/pipermail/ffmpeg-devel/2022-June/297923.html > Please confirm that it actually fixes the testcase its commit message > claims to fix. confirmed! thx > 2. The RAP_B_Bossen_1 and NoOutPrior_A_Qualcomm_1 (where the testcases > change due to your patch) contain completely fine end of sequence NALUs. > Because they are valid, stripping them (as your patch does) is not ok > (e.g. these units would even be discarded when using hevc_metadata). > There are two bugs with these units: > a) Our parser puts them at the beginning of their NALUs, yet they should > be at the end of the (preceding) NALU. > b) When remuxing the samples to Matroska with mkvmerge (which puts these > units at the end of their packets), the output is the same as with raw > input, i.e. decoder still misses some frames. So somehow these units > confuse the decoder. [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Old school: Use the lowest level language in which you can solve the problem conveniently. New school: Use the highest level language in which the latest supercomputer can solve the problem without the user falling asleep waiting. [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 195 bytes --] [-- 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". ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-06-24 0:03 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-04-29 22:18 [FFmpeg-devel] [PATCH 1/2] tools/target_dec_fuzzer: Adjust threshold or CFHD Michael Niedermayer 2022-04-29 22:18 ` [FFmpeg-devel] [PATCH 2/2] avcodec/h2645_parse: Check HEVC NAL size Michael Niedermayer 2022-04-30 9:35 ` Michael Niedermayer 2022-04-30 20:45 ` Andreas Rheinhardt 2022-06-22 11:05 ` Andreas Rheinhardt 2022-06-24 0:03 ` Michael Niedermayer
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