From 97befd7fcb985b0c038fb200e2c8fea9861ba1fd Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Thu, 27 Apr 2023 10:44:20 +0200 Subject: [PATCH] avcodec/interplayacm: do not use NULL for av_log() --- libavcodec/interplayacm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libavcodec/interplayacm.c b/libavcodec/interplayacm.c index a0b9655e7a..057ab16e85 100644 --- a/libavcodec/interplayacm.c +++ b/libavcodec/interplayacm.c @@ -37,6 +37,7 @@ static int mul_3x5 [5 * 5 * 5]; static int mul_2x11[11 * 11]; typedef struct InterplayACMContext { + AVCodecContext *avctx; GetBitContext gb; uint8_t *bitstream; int max_framesize; @@ -77,6 +78,7 @@ static av_cold int decode_init(AVCodecContext *avctx) static AVOnce init_static_once = AV_ONCE_INIT; InterplayACMContext *s = avctx->priv_data; + s->avctx = avctx; if (avctx->extradata_size < 14) return AVERROR_INVALIDDATA; @@ -343,7 +345,7 @@ static int t15(InterplayACMContext *s, unsigned ind, unsigned col) /* b = (x1) + (x2 * 3) + (x3 * 9) */ b = get_bits(gb, 5); if (b > 26) { - av_log(NULL, AV_LOG_ERROR, "Too large b = %d > 26\n", b); + av_log(s->avctx, AV_LOG_ERROR, "Too large b = %d > 26\n", b); return AVERROR_INVALIDDATA; } @@ -372,7 +374,7 @@ static int t27(InterplayACMContext *s, unsigned ind, unsigned col) /* b = (x1) + (x2 * 5) + (x3 * 25) */ b = get_bits(gb, 7); if (b > 124) { - av_log(NULL, AV_LOG_ERROR, "Too large b = %d > 124\n", b); + av_log(s->avctx, AV_LOG_ERROR, "Too large b = %d > 124\n", b); return AVERROR_INVALIDDATA; } @@ -400,7 +402,7 @@ static int t37(InterplayACMContext *s, unsigned ind, unsigned col) /* b = (x1) + (x2 * 11) */ b = get_bits(gb, 7); if (b > 120) { - av_log(NULL, AV_LOG_ERROR, "Too large b = %d > 120\n", b); + av_log(s->avctx, AV_LOG_ERROR, "Too large b = %d > 120\n", b); return AVERROR_INVALIDDATA; }