Commit c4ab699c authored by Laurent Aimar's avatar Laurent Aimar Committed by Derk-Jan Hartman

Made sure that our output buffer is large enough with TTA.

It allows playing multi-channels TTA and fixed a segfault as the decoder
does not check for sufficient space.
(cherry picked from commit 698c8900)
Signed-off-by: default avatarDerk-Jan Hartman <hartman@videolan.org>
parent 60d193b0
......@@ -186,6 +186,11 @@ int InitAudioDec( decoder_t *p_dec, AVCodecContext *p_context,
case CODEC_ID_WAVPACK:
p_sys->i_output_max = 8 * sizeof(int32_t) * 131072;
break;
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 4, 0 )
case CODEC_ID_TTA:
p_sys->i_output_max = p_sys->p_context->channels * sizeof(int32_t) * p_sys->p_context->sample_rate * 2;
break;
#endif
case CODEC_ID_FLAC:
p_sys->i_output_max = 8 * sizeof(int32_t) * 65535;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment