Made sure that our output buffer is large enough with TTA.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 28 Jun 2009 22:16:36 +0000 (00:16 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 28 Jun 2009 22:16:36 +0000 (00:16 +0200)
It allows playing multi-channels TTA and fixed a segfault as the decoder
does not check for sufficient space.

modules/codec/avcodec/audio.c

index 9d7a056..d86c0bf 100644 (file)
@@ -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;