| 988 | } |
| 989 | |
| 990 | static int wv_dsd_reset(WavpackContext *s, int channels) |
| 991 | { |
| 992 | int i; |
| 993 | |
| 994 | s->dsd_channels = 0; |
| 995 | av_refstruct_unref(&s->dsdctx); |
| 996 | av_refstruct_unref(&s->curr_progress); |
| 997 | av_refstruct_unref(&s->prev_progress); |
| 998 | |
| 999 | if (!channels) |
| 1000 | return 0; |
| 1001 | |
| 1002 | if (WV_MAX_CHANNELS > SIZE_MAX / sizeof(*s->dsdctx) && |
| 1003 | channels > SIZE_MAX / sizeof(*s->dsdctx)) |
| 1004 | return AVERROR(EINVAL); |
| 1005 | |
| 1006 | s->dsdctx = av_refstruct_allocz(channels * sizeof(*s->dsdctx)); |
| 1007 | if (!s->dsdctx) |
| 1008 | return AVERROR(ENOMEM); |
| 1009 | s->dsd_channels = channels; |
| 1010 | |
| 1011 | for (i = 0; i < channels; i++) |
| 1012 | memset(s->dsdctx[i].buf, 0x69, sizeof(s->dsdctx[i].buf)); |
| 1013 | |
| 1014 | ff_init_dsd_data(); |
| 1015 | |
| 1016 | return 0; |
| 1017 | } |
| 1018 | |
| 1019 | #if HAVE_THREADS |
| 1020 | static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src) |
no test coverage detected