X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavcodec%2Fopusdec.c;h=759eaa529cc1ea054cfcf6a0cbb0dc83fcd92af6;hp=b28edfbcd962bce33bc0983d1e09948072acd5c4;hb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00 diff --git a/ffmpeg/libavcodec/opusdec.c b/ffmpeg/libavcodec/opusdec.c index b28edfb..759eaa5 100644 --- a/ffmpeg/libavcodec/opusdec.c +++ b/ffmpeg/libavcodec/opusdec.c @@ -499,6 +499,12 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data, av_log(avctx, AV_LOG_ERROR, "Error parsing the packet header.\n"); return ret; } + if (coded_samples != s->packet.frame_count * s->packet.frame_duration) { + av_log(avctx, AV_LOG_ERROR, + "Mismatching coded sample count in substream %d.\n", i); + return AVERROR_INVALIDDATA; + } + s->silk_samplerate = get_silk_samplerate(s->packet.config); } @@ -529,7 +535,7 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data, } if (c->gain_i) { - c->fdsp.vector_fmul_scalar((float*)frame->extended_data[i], + c->fdsp->vector_fmul_scalar((float*)frame->extended_data[i], (float*)frame->extended_data[i], c->gain, FFALIGN(decoded_samples, 8)); } @@ -583,6 +589,7 @@ static av_cold int opus_decode_close(AVCodecContext *avctx) c->nb_streams = 0; av_freep(&c->channel_maps); + av_freep(&c->fdsp); return 0; } @@ -595,7 +602,9 @@ static av_cold int opus_decode_init(AVCodecContext *avctx) avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; avctx->sample_rate = 48000; - avpriv_float_dsp_init(&c->fdsp, 0); + c->fdsp = avpriv_float_dsp_alloc(0); + if (!c->fdsp) + return AVERROR(ENOMEM); /* find out the channel configuration */ ret = ff_opus_parse_extradata(avctx, c); @@ -624,7 +633,7 @@ static av_cold int opus_decode_init(AVCodecContext *avctx) s->redundancy_output[j] = s->redundancy_buf[j]; } - s->fdsp = &c->fdsp; + s->fdsp = c->fdsp; s->swr =swr_alloc(); if (!s->swr)