diff mbox

[FFmpeg-devel,3/5] avcodec/hevc_parse: ignore all non parameter set NAL units in extradata

Message ID 20170403014545.3704-3-jamrial@gmail.com
State Accepted
Headers show

Commit Message

James Almer April 3, 2017, 1:45 a.m. UTC
While they shouldn't be present, they are harmless if they are.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/hevc_parse.c | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)

Comments

Michael Niedermayer April 3, 2017, 10:04 a.m. UTC | #1
On Sun, Apr 02, 2017 at 10:45:43PM -0300, James Almer wrote:
> While they shouldn't be present, they are harmless if they are.
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavcodec/hevc_parse.c | 21 ++-------------------
>  1 file changed, 2 insertions(+), 19 deletions(-)

should be ok but maybe wait before applying so others can comment too

[...]
James Almer April 7, 2017, 8:25 p.m. UTC | #2
On 4/3/2017 7:04 AM, Michael Niedermayer wrote:
> On Sun, Apr 02, 2017 at 10:45:43PM -0300, James Almer wrote:
>> While they shouldn't be present, they are harmless if they are.
>>
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>>  libavcodec/hevc_parse.c | 21 ++-------------------
>>  1 file changed, 2 insertions(+), 19 deletions(-)
> 
> should be ok but maybe wait before applying so others can comment too

Pushed, thanks.
diff mbox

Patch

diff --git a/libavcodec/hevc_parse.c b/libavcodec/hevc_parse.c
index 3b817c4f4d..ee4cd54d3e 100644
--- a/libavcodec/hevc_parse.c
+++ b/libavcodec/hevc_parse.c
@@ -54,25 +54,8 @@  static int hevc_decode_nal_units(const uint8_t *buf, int buf_size, HEVCParamSets
             if (ret < 0)
                 goto done;
             break;
-        case HEVC_NAL_TRAIL_R:
-        case HEVC_NAL_TRAIL_N:
-        case HEVC_NAL_TSA_N:
-        case HEVC_NAL_TSA_R:
-        case HEVC_NAL_STSA_N:
-        case HEVC_NAL_STSA_R:
-        case HEVC_NAL_BLA_W_LP:
-        case HEVC_NAL_BLA_W_RADL:
-        case HEVC_NAL_BLA_N_LP:
-        case HEVC_NAL_IDR_W_RADL:
-        case HEVC_NAL_IDR_N_LP:
-        case HEVC_NAL_CRA_NUT:
-        case HEVC_NAL_RADL_N:
-        case HEVC_NAL_RADL_R:
-        case HEVC_NAL_RASL_N:
-        case HEVC_NAL_RASL_R:
-            av_log(logctx, AV_LOG_ERROR, "Invalid NAL unit: %d\n", nal->type);
-            ret = AVERROR_INVALIDDATA;
-            goto done;
+        default:
+            av_log(logctx, AV_LOG_VERBOSE, "Ignoring NAL type %d in extradata\n", nal->type);
             break;
         }
     }