Unified · Split
| @@ -37,6 +37,7 @@ static int mul_3x5 [5 * 5 * 5]; · 36 unmodified lines | |||
| 37 | static int mul_2x11[11 * 11]; | 37 | static int mul_2x11[11 * 11]; |
| 38 | 38 | ||
| 39 | typedef struct InterplayACMContext { | 39 | typedef struct InterplayACMContext { |
| 40 | AVCodecContext *avctx; | ||
| 40 | GetBitContext gb; | 41 | GetBitContext gb; |
| 41 | uint8_t *bitstream; | 42 | uint8_t *bitstream; |
| 42 | int max_framesize; | 43 | int max_framesize; |
| @@ -77,6 +78,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 34 unmodified lines | |||
| 77 | static AVOnce init_static_once = AV_ONCE_INIT; | 78 | static AVOnce init_static_once = AV_ONCE_INIT; |
| 78 | InterplayACMContext *s = avctx->priv_data; | 79 | InterplayACMContext *s = avctx->priv_data; |
| 79 | 80 | ||
| 81 | s->avctx = avctx; | ||
| 80 | if (avctx->extradata_size < 14) | 82 | if (avctx->extradata_size < 14) |
| 81 | return AVERROR_INVALIDDATA; | 83 | return AVERROR_INVALIDDATA; |
| 82 | 84 | ||
| @@ -343,7 +345,7 @@ static int t15(InterplayACMContext *s, unsigned ind, unsigned col) · 260 unmodified lines | |||
| 343 | /* b = (x1) + (x2 * 3) + (x3 * 9) */ | 345 | /* b = (x1) + (x2 * 3) + (x3 * 9) */ |
| 344 | b = get_bits(gb, 5); | 346 | b = get_bits(gb, 5); |
| 345 | if (b > 26) { | 347 | if (b > 26) { |
| 346 | av_log(NULL, AV_LOG_ERROR, "Too large b = %d > 26\n", b); | 348 | av_log(s->avctx, AV_LOG_ERROR, "Too large b = %d > 26\n", b); |
| 347 | return AVERROR_INVALIDDATA; | 349 | return AVERROR_INVALIDDATA; |
| 348 | } | 350 | } |
| 349 | 351 | ||
| @@ -372,7 +374,7 @@ static int t27(InterplayACMContext *s, unsigned ind, unsigned col) · 22 unmodified lines | |||
| 372 | /* b = (x1) + (x2 * 5) + (x3 * 25) */ | 374 | /* b = (x1) + (x2 * 5) + (x3 * 25) */ |
| 373 | b = get_bits(gb, 7); | 375 | b = get_bits(gb, 7); |
| 374 | if (b > 124) { | 376 | if (b > 124) { |
| 375 | av_log(NULL, AV_LOG_ERROR, "Too large b = %d > 124\n", b); | 377 | av_log(s->avctx, AV_LOG_ERROR, "Too large b = %d > 124\n", b); |
| 376 | return AVERROR_INVALIDDATA; | 378 | return AVERROR_INVALIDDATA; |
| 377 | } | 379 | } |
| 378 | 380 | ||
| @@ -400,7 +402,7 @@ static int t37(InterplayACMContext *s, unsigned ind, unsigned col) · 21 unmodified lines | |||
| 400 | /* b = (x1) + (x2 * 11) */ | 402 | /* b = (x1) + (x2 * 11) */ |
| 401 | b = get_bits(gb, 7); | 403 | b = get_bits(gb, 7); |
| 402 | if (b > 120) { | 404 | if (b > 120) { |
| 403 | av_log(NULL, AV_LOG_ERROR, "Too large b = %d > 120\n", b); | 405 | av_log(s->avctx, AV_LOG_ERROR, "Too large b = %d > 120\n", b); |
| 404 | return AVERROR_INVALIDDATA; | 406 | return AVERROR_INVALIDDATA; |
| 405 | } | 407 | } |
| 406 | 408 | ||