| @@ -166,17 +166,17 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) · 165 unmodified lines |
| 166 | /* Read probabilities from bitstream */ | 166 | /* Read probabilities from bitstream */ |
| 167 | for (i = 1; i < 257; i++) { | 167 | for (i = 1; i < 257; i++) { |
| 168 | if (lag_decode_prob(gb, &rac->prob[i]) < 0) { | 168 | if (lag_decode_prob(gb, &rac->prob[i]) < 0) { |
| 169 | av_log(rac->avctx, AV_LOG_ERROR, "Invalid probability encountered.\n"); | 169 | av_log(rac->logctx, AV_LOG_ERROR, "Invalid probability encountered.\n"); |
| 170 | return AVERROR_INVALIDDATA; | 170 | return AVERROR_INVALIDDATA; |
| 171 | } | 171 | } |
| 172 | if ((uint64_t)cumul_prob + rac->prob[i] > UINT_MAX) { | 172 | if ((uint64_t)cumul_prob + rac->prob[i] > UINT_MAX) { |
| 173 | av_log(rac->avctx, AV_LOG_ERROR, "Integer overflow encountered in cumulative probability calculation.\n"); | 173 | av_log(rac->logctx, AV_LOG_ERROR, "Integer overflow encountered in cumulative probability calculation.\n"); |
| 174 | return AVERROR_INVALIDDATA; | 174 | return AVERROR_INVALIDDATA; |
| 175 | } | 175 | } |
| 176 | cumul_prob += rac->prob[i]; | 176 | cumul_prob += rac->prob[i]; |
| 177 | if (!rac->prob[i]) { | 177 | if (!rac->prob[i]) { |
| 178 | if (lag_decode_prob(gb, &prob)) { | 178 | if (lag_decode_prob(gb, &prob)) { |
| 179 | av_log(rac->avctx, AV_LOG_ERROR, "Invalid probability run encountered.\n"); | 179 | av_log(rac->logctx, AV_LOG_ERROR, "Invalid probability run encountered.\n"); |
| 180 | return AVERROR_INVALIDDATA; | 180 | return AVERROR_INVALIDDATA; |
| 181 | } | 181 | } |
| 182 | if (prob > 256 - i) | 182 | if (prob > 256 - i) |
| @@ -189,7 +189,7 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) · 6 unmodified lines |
| 189 | } | 189 | } |
| 190 | | 190 | |
| 191 | if (!cumul_prob) { | 191 | if (!cumul_prob) { |
| 192 | av_log(rac->avctx, AV_LOG_ERROR, "All probabilities are 0!\n"); | 192 | av_log(rac->logctx, AV_LOG_ERROR, "All probabilities are 0!\n"); |
| 193 | return AVERROR_INVALIDDATA; | 193 | return AVERROR_INVALIDDATA; |
| 194 | } | 194 | } |
| 195 | | 195 | |
| @@ -207,7 +207,7 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) · 11 unmodified lines |
| 207 | scaled_cumul_prob += rac->prob[i]; | 207 | scaled_cumul_prob += rac->prob[i]; |
| 208 | } | 208 | } |
| 209 | if (scaled_cumul_prob <= 0) { | 209 | if (scaled_cumul_prob <= 0) { |
| 210 | av_log(rac->avctx, AV_LOG_ERROR, "Scaled probabilities invalid\n"); | 210 | av_log(rac->logctx, AV_LOG_ERROR, "Scaled probabilities invalid\n"); |
| 211 | return AVERROR_INVALIDDATA; | 211 | return AVERROR_INVALIDDATA; |
| 212 | } | 212 | } |
| 213 | for (; i < 257; i++) { | 213 | for (; i < 257; i++) { |
| @@ -221,7 +221,7 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb) · 7 unmodified lines |
| 221 | cumulative_target = 1U << scale_factor; | 221 | cumulative_target = 1U << scale_factor; |
| 222 | | 222 | |
| 223 | if (scaled_cumul_prob > cumulative_target) { | 223 | if (scaled_cumul_prob > cumulative_target) { |
| 224 | av_log(rac->avctx, AV_LOG_ERROR, | 224 | av_log(rac->logctx, AV_LOG_ERROR, |
| 225 | "Scaled probabilities are larger than target!\n"); | 225 | "Scaled probabilities are larger than target!\n"); |
| 226 | return AVERROR_INVALIDDATA; | 226 | return AVERROR_INVALIDDATA; |
| 227 | } | 227 | } |
| @@ -463,7 +463,7 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst, · 235 unmodified lines |
| 463 | const uint8_t *src_end = src + src_size; | 463 | const uint8_t *src_end = src + src_size; |
| 464 | int ret; | 464 | int ret; |
| 465 | | 465 | |
| 466 | rac.avctx = l->avctx; | 466 | rac.logctx = l->avctx; |
| 467 | l->zeros = 0; | 467 | l->zeros = 0; |
| 468 | | 468 | |
| 469 | if(src_size < 2) | 469 | if(src_size < 2) |