~noskcaj/ubuntu/saucy/libav/merge0.8.7-1

« back to all changes in this revision

Viewing changes to libavcodec/svq3.c

  • Committer: Package Import Robot
  • Author(s): Micah Gersten
  • Date: 2012-03-21 21:18:24 UTC
  • mfrom: (1.2.10)
  • Revision ID: package-import@ubuntu.com-20120321211824-n63p3v3s99q3mxrb
Tags: 4:0.8.1-0ubuntu1
* New upstream bug and security fix release (FFe: LP: #960949)
  - fixes the following CVEs:
    CVE-2012-0848, CVE-2012-0853, CVE-2012-0858, CVE-2011-3929,
    CVE-2011-3936, CVE-2011-3937, CVE-2011-3940, CVE-2011-3945,
    CVE-2011-3947, CVE-2011-3951, CVE-2011-3952

* Pull fix from Debian git to fix installation of avserver.conf and
  recordshow.sh into libav-tools; Thanks to Julien Cristau for spotting this!
  - update debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
{
174
174
    const int qmul = svq3_dequant_coeff[qp];
175
175
    int i;
176
 
    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
177
176
 
178
177
    if (dc) {
179
178
        dc = 13*13*((dc == 1) ? 1538*block[0] : ((qmul*(block[0] >> 3)) / 2));
199
198
        const int z3 = 17* block[i + 4*1] +  7*block[i + 4*3];
200
199
        const int rr = (dc + 0x80000);
201
200
 
202
 
        dst[i + stride*0] = cm[ dst[i + stride*0] + (((z0 + z3)*qmul + rr) >> 20) ];
203
 
        dst[i + stride*1] = cm[ dst[i + stride*1] + (((z1 + z2)*qmul + rr) >> 20) ];
204
 
        dst[i + stride*2] = cm[ dst[i + stride*2] + (((z1 - z2)*qmul + rr) >> 20) ];
205
 
        dst[i + stride*3] = cm[ dst[i + stride*3] + (((z0 - z3)*qmul + rr) >> 20) ];
 
201
        dst[i + stride*0] = av_clip_uint8( dst[i + stride*0] + (((z0 + z3)*qmul + rr) >> 20) );
 
202
        dst[i + stride*1] = av_clip_uint8( dst[i + stride*1] + (((z1 + z2)*qmul + rr) >> 20) );
 
203
        dst[i + stride*2] = av_clip_uint8( dst[i + stride*2] + (((z1 - z2)*qmul + rr) >> 20) );
 
204
        dst[i + stride*3] = av_clip_uint8( dst[i + stride*3] + (((z0 - z3)*qmul + rr) >> 20) );
206
205
    }
207
206
}
208
207
 
612
611
        dir = i_mb_type_info[mb_type - 8].pred_mode;
613
612
        dir = (dir >> 1) ^ 3*(dir & 1) ^ 1;
614
613
 
615
 
        if ((h->intra16x16_pred_mode = ff_h264_check_intra_pred_mode(h, dir)) == -1){
 
614
        if ((h->intra16x16_pred_mode = ff_h264_check_intra_pred_mode(h, dir, 0)) == -1){
616
615
            av_log(h->s.avctx, AV_LOG_ERROR, "check_intra_pred_mode = -1\n");
617
616
            return -1;
618
617
        }
651
650
    if (IS_INTRA16x16(mb_type) || (s->pict_type != AV_PICTURE_TYPE_I && s->adaptive_quant && cbp)) {
652
651
        s->qscale += svq3_get_se_golomb(&s->gb);
653
652
 
654
 
        if (s->qscale > 31){
 
653
        if (s->qscale > 31u){
655
654
            av_log(h->s.avctx, AV_LOG_ERROR, "qscale:%d\n", s->qscale);
656
655
            return -1;
657
656
        }
711
710
    s->current_picture.f.mb_type[mb_xy] = mb_type;
712
711
 
713
712
    if (IS_INTRA(mb_type)) {
714
 
        h->chroma_pred_mode = ff_h264_check_intra_pred_mode(h, DC_PRED8x8);
 
713
        h->chroma_pred_mode = ff_h264_check_intra_pred_mode(h, DC_PRED8x8, 1);
715
714
    }
716
715
 
717
716
    return 0;
811
810
    MpegEncContext *s = &h->s;
812
811
    int m;
813
812
    unsigned char *extradata;
 
813
    unsigned char *extradata_end;
814
814
    unsigned int size;
 
815
    int marker_found = 0;
815
816
 
816
817
    if (ff_h264_decode_init(avctx) < 0)
817
818
        return -1;
831
832
 
832
833
        /* prowl for the "SEQH" marker in the extradata */
833
834
        extradata = (unsigned char *)avctx->extradata;
834
 
        for (m = 0; m < avctx->extradata_size; m++) {
835
 
            if (!memcmp(extradata, "SEQH", 4))
836
 
                break;
837
 
            extradata++;
 
835
        extradata_end = avctx->extradata + avctx->extradata_size;
 
836
        if (extradata) {
 
837
            for (m = 0; m + 8 < avctx->extradata_size; m++) {
 
838
                if (!memcmp(extradata, "SEQH", 4)) {
 
839
                    marker_found = 1;
 
840
                    break;
 
841
                }
 
842
                extradata++;
 
843
            }
838
844
        }
839
845
 
840
846
        /* if a match was found, parse the extra data */
841
 
        if (extradata && !memcmp(extradata, "SEQH", 4)) {
 
847
        if (marker_found) {
842
848
 
843
849
            GetBitContext gb;
844
850
            int frame_size_code;
845
851
 
846
852
            size = AV_RB32(&extradata[4]);
 
853
            if (size > extradata_end - extradata - 8)
 
854
                return AVERROR_INVALIDDATA;
847
855
            init_get_bits(&gb, extradata + 8, size*8);
848
856
 
849
857
            /* 'frame size code' and optional 'width, height' */