[FFmpeg-devel] lavc/videotoolboxenc: make transfer_fnc initialized for unsupport function

Submitted by lance.lmwang@gmail.com on July 17, 2019, 10:59 p.m.

Details

Message ID 20190717225935.6156-1-lance.lmwang@gmail.com
State Accepted
Commit 1ee863a7b05aaf358c43c3a788e020cc1c752c59
Headers show

Commit Message

lance.lmwang@gmail.com July 17, 2019, 10:59 p.m.
From: Limin Wang <lance.lmwang@gmail.com>

The current function will report one error message, but the caller func 
haven't check it, so change the default to process as AVCOL_TRC_UNSPECIFIED.

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavcodec/videotoolboxenc.c | 1 +
 1 file changed, 1 insertion(+)

Comments

lance.lmwang@gmail.com Aug. 10, 2019, 3:02 p.m.
ping the change!

On Thu, Jul 18, 2019 at 06:59:35AM +0800, lance.lmwang@gmail.com wrote:
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> The current function will report one error message, but the caller func 
> haven't check it, so change the default to process as AVCOL_TRC_UNSPECIFIED.
> 
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>  libavcodec/videotoolboxenc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
> index ece9d6e..d76bb7f 100644
> --- a/libavcodec/videotoolboxenc.c
> +++ b/libavcodec/videotoolboxenc.c
> @@ -949,6 +949,7 @@ static int get_cv_transfer_function(AVCodecContext *avctx,
>              break;
>  
>          default:
> +            *transfer_fnc = NULL;
>              av_log(avctx, AV_LOG_ERROR, "Transfer function %s is not supported.\n", av_color_transfer_name(trc));
>              return -1;
>      }
> -- 
> 2.6.4
>
Richard Kern Aug. 11, 2019, 2:54 p.m.
On Sat, Aug 10, 2019 at 11:02 AM Limin Wang <lance.lmwang@gmail.com> wrote:

>
>
> ping the change!
>
Tests look good. Pushed.


>
> On Thu, Jul 18, 2019 at 06:59:35AM +0800, lance.lmwang@gmail.com wrote:
> > From: Limin Wang <lance.lmwang@gmail.com>
> >
> > The current function will report one error message, but the caller func
> > haven't check it, so change the default to process as
> AVCOL_TRC_UNSPECIFIED.
> >
> > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> > ---
> >  libavcodec/videotoolboxenc.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
> > index ece9d6e..d76bb7f 100644
> > --- a/libavcodec/videotoolboxenc.c
> > +++ b/libavcodec/videotoolboxenc.c
> > @@ -949,6 +949,7 @@ static int get_cv_transfer_function(AVCodecContext
> *avctx,
> >              break;
> >
> >          default:
> > +            *transfer_fnc = NULL;
> >              av_log(avctx, AV_LOG_ERROR, "Transfer function %s is not
> supported.\n", av_color_transfer_name(trc));
> >              return -1;
> >      }
> > --
> > 2.6.4
> >
> _______________________________________________
> 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".

Patch hide | download patch | download mbox

diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index ece9d6e..d76bb7f 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -949,6 +949,7 @@  static int get_cv_transfer_function(AVCodecContext *avctx,
             break;
 
         default:
+            *transfer_fnc = NULL;
             av_log(avctx, AV_LOG_ERROR, "Transfer function %s is not supported.\n", av_color_transfer_name(trc));
             return -1;
     }