Revision 9c856d62

View differences:

libavcodec/utils.c
894 894
{
895 895
    int ret;
896 896

  
897
    //FIXME remove the check below _after_ ensuring that all audio check that the available space is enough
898
    if(*frame_size_ptr < AVCODEC_MAX_AUDIO_FRAME_SIZE){
899
        av_log(avctx, AV_LOG_ERROR, "buffer smaller than AVCODEC_MAX_AUDIO_FRAME_SIZE\n");
900
        return -1;
901
    }
902
    if(*frame_size_ptr < FF_MIN_BUFFER_SIZE ||
903
       *frame_size_ptr < avctx->channels * avctx->frame_size * sizeof(int16_t) ||
904
       *frame_size_ptr < buf_size){
905
        av_log(avctx, AV_LOG_ERROR, "buffer %d too small\n", *frame_size_ptr);
906
        return -1;
907
    }
908 897
    if((avctx->codec->capabilities & CODEC_CAP_DELAY) || buf_size){
898
        //FIXME remove the check below _after_ ensuring that all audio check that the available space is enough
899
        if(*frame_size_ptr < AVCODEC_MAX_AUDIO_FRAME_SIZE){
900
            av_log(avctx, AV_LOG_ERROR, "buffer smaller than AVCODEC_MAX_AUDIO_FRAME_SIZE\n");
901
            return -1;
902
        }
903
        if(*frame_size_ptr < FF_MIN_BUFFER_SIZE ||
904
        *frame_size_ptr < avctx->channels * avctx->frame_size * sizeof(int16_t) ||
905
        *frame_size_ptr < buf_size){
906
            av_log(avctx, AV_LOG_ERROR, "buffer %d too small\n", *frame_size_ptr);
907
            return -1;
908
        }
909

  
909 910
        ret = avctx->codec->decode(avctx, samples, frame_size_ptr,
910 911
                                buf, buf_size);
911 912
        avctx->frame_number++;

Also available in: Unified diff