diff mbox

[FFmpeg-devel,11/11] avcodec/bfi: Provide non NULL context to av_log()

Message ID 20181231210318.6130-11-michael@niedermayer.cc
State Accepted
Commit 1dcb5b7dca2bbaa7e2dfa062c0941f5509c238f4
Headers show

Commit Message

Michael Niedermayer Dec. 31, 2018, 9:03 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/bfi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul B Mahol Jan. 1, 2019, 11:02 a.m. UTC | #1
On 12/31/18, Michael Niedermayer <michael@niedermayer.cc> wrote:
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/bfi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/bfi.c b/libavcodec/bfi.c
> index 233a1d27a8..a4cb002053 100644
> --- a/libavcodec/bfi.c
> +++ b/libavcodec/bfi.c
> @@ -71,7 +71,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, void
> *data,
>          frame->key_frame = 1;
>          /* Setting the palette */
>          if (avctx->extradata_size > 768) {
> -            av_log(NULL, AV_LOG_ERROR, "Palette is too large.\n");
> +            av_log(avctx, AV_LOG_ERROR, "Palette is too large.\n");
>              return AVERROR_INVALIDDATA;
>          }
>          pal = (uint32_t *)frame->data[1];
> --
> 2.20.1
>

All changes in set are trivial, so LGTM.
Michael Niedermayer Jan. 1, 2019, 11:44 a.m. UTC | #2
On Tue, Jan 01, 2019 at 12:02:22PM +0100, Paul B Mahol wrote:
> On 12/31/18, Michael Niedermayer <michael@niedermayer.cc> wrote:
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavcodec/bfi.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/bfi.c b/libavcodec/bfi.c
> > index 233a1d27a8..a4cb002053 100644
> > --- a/libavcodec/bfi.c
> > +++ b/libavcodec/bfi.c
> > @@ -71,7 +71,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, void
> > *data,
> >          frame->key_frame = 1;
> >          /* Setting the palette */
> >          if (avctx->extradata_size > 768) {
> > -            av_log(NULL, AV_LOG_ERROR, "Palette is too large.\n");
> > +            av_log(avctx, AV_LOG_ERROR, "Palette is too large.\n");
> >              return AVERROR_INVALIDDATA;
> >          }
> >          pal = (uint32_t *)frame->data[1];
> > --
> > 2.20.1
> >
> 
> All changes in set are trivial, so LGTM.

will apply

btw, if people want me to push trivial looking changes directly, i can skip
sending such patches in the future, but people have previously complained
repeatly when i pushed without sending patches. 
I cant send patches just when there would be someone who wanted to see the
patch, because i dont know that  ...

thx

[...]
Nicolas George Jan. 1, 2019, 12:23 p.m. UTC | #3
Michael Niedermayer (2019-01-01):
> btw, if people want me to push trivial looking changes directly, i can skip
> sending such patches in the future, but people have previously complained
> repeatly when i pushed without sending patches. 
> I cant send patches just when there would be someone who wanted to see the
> patch, because i dont know that  ...

Better submit a trivial patch than have a mistake creep in.

We had quite a few patches pushed without review in the last few weeks
that caused Coverity regressions. Maybe let us take that as lessons.

Regards,
diff mbox

Patch

diff --git a/libavcodec/bfi.c b/libavcodec/bfi.c
index 233a1d27a8..a4cb002053 100644
--- a/libavcodec/bfi.c
+++ b/libavcodec/bfi.c
@@ -71,7 +71,7 @@  static int bfi_decode_frame(AVCodecContext *avctx, void *data,
         frame->key_frame = 1;
         /* Setting the palette */
         if (avctx->extradata_size > 768) {
-            av_log(NULL, AV_LOG_ERROR, "Palette is too large.\n");
+            av_log(avctx, AV_LOG_ERROR, "Palette is too large.\n");
             return AVERROR_INVALIDDATA;
         }
         pal = (uint32_t *)frame->data[1];