diff mbox

[FFmpeg-devel] lavc/hevc_ps: Be less strict on sps conformance by default.

Message ID CAB0OVGqL-zncZRVG1cEVAjT13HaLgWkhH=idLceS9X+WOWc=Uw@mail.gmail.com
State Superseded
Headers show

Commit Message

Carl Eugen Hoyos Aug. 30, 2017, 10:05 a.m. UTC
Hi!

Attached patch allows users to control the sps conformance
requirement: It allows to revert the fix for ticket #4035, so faulty
streams can be ignored.
Also fixes a user-provided sample.

Please comment, Carl Eugen

Comments

Michael Niedermayer Aug. 31, 2017, 12:25 a.m. UTC | #1
On Wed, Aug 30, 2017 at 12:05:32PM +0200, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch allows users to control the sps conformance
> requirement: It allows to revert the fix for ticket #4035, so faulty
> streams can be ignored.
> Also fixes a user-provided sample.
> 
> Please comment, Carl Eugen

>  hevc_ps.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 46c5772fae6f32bb580246c84ed42e4070834c77  0001-lavc-hevc_ps-Be-less-strict-on-sps-conformance-by-de.patch
> From d2a4241f52c7e5b4b5226f7aed237e7448815b77 Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
> Date: Wed, 30 Aug 2017 11:55:15 +0200
> Subject: [PATCH] lavc/hevc_ps: Be less strict on sps conformance by default.
> 
> ---
>  libavcodec/hevc_ps.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
> index 37eae22..6d12d90 100644
> --- a/libavcodec/hevc_ps.c
> +++ b/libavcodec/hevc_ps.c
> @@ -1187,7 +1187,8 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
>      if (get_bits_left(gb) < 0) {
>          av_log(avctx, AV_LOG_ERROR,
>                 "Overread SPS by %d bits\n", -get_bits_left(gb));
> -        return AVERROR_INVALIDDATA;
> +        if (avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT)
> +            return AVERROR_INVALIDDATA;

This is likely not correct

when get_bits_left becomes smaller than 0 then parsing went wrong
prior


[...]
diff mbox

Patch

From d2a4241f52c7e5b4b5226f7aed237e7448815b77 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Wed, 30 Aug 2017 11:55:15 +0200
Subject: [PATCH] lavc/hevc_ps: Be less strict on sps conformance by default.

---
 libavcodec/hevc_ps.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index 37eae22..6d12d90 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -1187,7 +1187,8 @@  int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
     if (get_bits_left(gb) < 0) {
         av_log(avctx, AV_LOG_ERROR,
                "Overread SPS by %d bits\n", -get_bits_left(gb));
-        return AVERROR_INVALIDDATA;
+        if (avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT)
+            return AVERROR_INVALIDDATA;
     }
 
     return 0;
-- 
1.7.10.4