av_frame_side_data_add() typically takes ownership of the provided AVBufferRef reference and therefore uses a parameter of type AVBufferRef**; yet with the AV_FRAME_SIDE_DATA_FLAG_NEW_REF, it creates new references instead, without touching the given reference. Therefore it is safe to cast const away.
Unified · Split
| @@ -366,7 +366,8 @@ int ff_aom_attach_film_grain_sets(const AVFilmGrainAFGS1Params *s, AVFrame *fram · 365 unmodified lines | |||
| 366 | continue; | 366 | continue; |
| 367 | 367 | ||
| 368 | if (!av_frame_side_data_add(&frame->side_data, &frame->nb_side_data, | 368 | if (!av_frame_side_data_add(&frame->side_data, &frame->nb_side_data, |
| 369 | AV_FRAME_DATA_FILM_GRAIN_PARAMS, &s->sets[i], | 369 | AV_FRAME_DATA_FILM_GRAIN_PARAMS, |
| 370 | (AVBufferRef**)&s->sets[i], | ||
| 370 | AV_FRAME_SIDE_DATA_FLAG_NEW_REF)) | 371 | AV_FRAME_SIDE_DATA_FLAG_NEW_REF)) |
| 371 | return AVERROR(ENOMEM); | 372 | return AVERROR(ENOMEM); |
| 372 | } | 373 | } |