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; }