The whole dc_val array is initialized (to 1024) immediately after the allocation.
Unified · Split
| @@ -340,7 +340,7 @@ av_cold int ff_mpv_init_context_frame(MpegEncContext *s) · 339 unmodified lines | |||
| 340 | // MN: we need these for error resilience of intra-frames | 340 | // MN: we need these for error resilience of intra-frames |
| 341 | // Allocating them unconditionally for decoders also means | 341 | // Allocating them unconditionally for decoders also means |
| 342 | // that we don't need to reinitialize when e.g. h263_aic changes. | 342 | // that we don't need to reinitialize when e.g. h263_aic changes. |
| 343 | if (!FF_ALLOCZ_TYPED_ARRAY(s->dc_val_base, yc_size)) | 343 | if (!FF_ALLOC_TYPED_ARRAY(s->dc_val_base, yc_size)) |
| 344 | return AVERROR(ENOMEM); | 344 | return AVERROR(ENOMEM); |
| 345 | s->dc_val[0] = s->dc_val_base + s->b8_stride + 1; | 345 | s->dc_val[0] = s->dc_val_base + s->b8_stride + 1; |
| 346 | s->dc_val[1] = s->dc_val_base + y_size + s->mb_stride + 1; | 346 | s->dc_val[1] = s->dc_val_base + y_size + s->mb_stride + 1; |