diff mbox series

[FFmpeg-devel] avcodec/h264_pc: Return error if pps has FMO parameters

Message ID 20200208222029.7966-1-andriy.gelman@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel] avcodec/h264_pc: Return error if pps has FMO parameters
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Andriy Gelman Feb. 8, 2020, 10:20 p.m. UTC
From: Andriy Gelman <andriy.gelman@gmail.com>

FMO is not supported and fields related to FMO are not parsed, meaning
that any fields which follow will be corrupt.
---
 libavcodec/h264_ps.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andriy Gelman Feb. 8, 2020, 10:31 p.m. UTC | #1
On Sat, 08. Feb 17:20, Andriy Gelman wrote:
> From: Andriy Gelman <andriy.gelman@gmail.com>
> 
> FMO is not supported and fields related to FMO are not parsed, meaning
> that any fields which follow will be corrupt.
> ---
>  libavcodec/h264_ps.c | 2 ++
>  1 file changed, 2 insertions(+)
> 

I have a typo in the commit message:
It should be avcodec/h264_ps

I'll update in the next version.
James Almer Feb. 9, 2020, 12:30 a.m. UTC | #2
On 2/8/2020 7:20 PM, Andriy Gelman wrote:
> From: Andriy Gelman <andriy.gelman@gmail.com>
> 
> FMO is not supported and fields related to FMO are not parsed, meaning
> that any fields which follow will be corrupt.
> ---
>  libavcodec/h264_ps.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
> index edbaa96b64e..80216854079 100644
> --- a/libavcodec/h264_ps.c
> +++ b/libavcodec/h264_ps.c
> @@ -794,6 +794,8 @@ int ff_h264_decode_picture_parameter_set(GetBitContext *gb, AVCodecContext *avct
>      if (pps->slice_group_count > 1) {
>          pps->mb_slice_group_map_type = get_ue_golomb(gb);
>          av_log(avctx, AV_LOG_ERROR, "FMO not supported\n");

Should probably be avpriv_report_missing_feature() instead. Look right
above this chunk for an usage example of this function.

> +        ret = AVERROR_PATCHWELCOME;
> +        goto fail;
>      }
>      pps->ref_count[0] = get_ue_golomb(gb) + 1;
>      pps->ref_count[1] = get_ue_golomb(gb) + 1;
>
Andriy Gelman Feb. 12, 2020, 11:39 p.m. UTC | #3
On Sat, 08. Feb 21:30, James Almer wrote:
> On 2/8/2020 7:20 PM, Andriy Gelman wrote:
> > From: Andriy Gelman <andriy.gelman@gmail.com>
> > 
> > FMO is not supported and fields related to FMO are not parsed, meaning
> > that any fields which follow will be corrupt.
> > ---
> >  libavcodec/h264_ps.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
> > index edbaa96b64e..80216854079 100644
> > --- a/libavcodec/h264_ps.c
> > +++ b/libavcodec/h264_ps.c
> > @@ -794,6 +794,8 @@ int ff_h264_decode_picture_parameter_set(GetBitContext *gb, AVCodecContext *avct
> >      if (pps->slice_group_count > 1) {
> >          pps->mb_slice_group_map_type = get_ue_golomb(gb);
> >          av_log(avctx, AV_LOG_ERROR, "FMO not supported\n");

> 
> Should probably be avpriv_report_missing_feature() instead. Look right
> above this chunk for an usage example of this function.
> 

Thanks, I've resent with this change.
diff mbox series

Patch

diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index edbaa96b64e..80216854079 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -794,6 +794,8 @@  int ff_h264_decode_picture_parameter_set(GetBitContext *gb, AVCodecContext *avct
     if (pps->slice_group_count > 1) {
         pps->mb_slice_group_map_type = get_ue_golomb(gb);
         av_log(avctx, AV_LOG_ERROR, "FMO not supported\n");
+        ret = AVERROR_PATCHWELCOME;
+        goto fail;
     }
     pps->ref_count[0] = get_ue_golomb(gb) + 1;
     pps->ref_count[1] = get_ue_golomb(gb) + 1;