Revision f8b12459 libavformat/asfdec.c

View differences:

libavformat/asfdec.c
853 853
    if (asf->packet_flags & 0x01) {
854 854
        DO_2BITS(asf->packet_segsizetype >> 6, asf->packet_frag_size, 0); // 0 is illegal
855 855
        if(asf->packet_frag_size > asf->packet_size_left - rsize){
856
            av_log(s, AV_LOG_ERROR, "packet_frag_size is invalid\n");
857
            return -1;
856
            if (asf->packet_frag_size > asf->packet_size_left - rsize + asf->packet_padsize) {
857
                av_log(s, AV_LOG_ERROR, "packet_frag_size is invalid (%d-%d)\n", asf->packet_size_left, rsize);
858
                return -1;
859
            } else {
860
                int diff = asf->packet_frag_size - (asf->packet_size_left - rsize);
861
                asf->packet_size_left += diff;
862
                asf->packet_padsize   -= diff;
863
            }
858 864
        }
859 865
        //printf("Fragsize %d\n", asf->packet_frag_size);
860 866
    } else {

Also available in: Unified diff