Revision 81752d0c

View differences:

libavcodec/mjpegbdec.c
69 69
    av_log(avctx, AV_LOG_DEBUG, "dqt offs: 0x%x\n", dqt_offs);
70 70
    if (dqt_offs)
71 71
    {
72
        init_get_bits(&s->gb, buf+dqt_offs, (buf_end - (buf+dqt_offs))*8);
72
        init_get_bits(&s->gb, buf_ptr+dqt_offs, (buf_end - (buf_ptr+dqt_offs))*8);
73 73
        s->start_code = DQT;
74 74
        ff_mjpeg_decode_dqt(s);
75 75
    }
......
78 78
    av_log(avctx, AV_LOG_DEBUG, "dht offs: 0x%x\n", dht_offs);
79 79
    if (dht_offs)
80 80
    {
81
        init_get_bits(&s->gb, buf+dht_offs, (buf_end - (buf+dht_offs))*8);
81
        init_get_bits(&s->gb, buf_ptr+dht_offs, (buf_end - (buf_ptr+dht_offs))*8);
82 82
        s->start_code = DHT;
83 83
        ff_mjpeg_decode_dht(s);
84 84
    }
......
87 87
    av_log(avctx, AV_LOG_DEBUG, "sof offs: 0x%x\n", sof_offs);
88 88
    if (sof_offs)
89 89
    {
90
        init_get_bits(&s->gb, buf+sof_offs, (buf_end - (buf+sof_offs))*8);
90
        init_get_bits(&s->gb, buf_ptr+sof_offs, (buf_end - (buf_ptr+sof_offs))*8);
91 91
        s->start_code = SOF0;
92 92
        if (ff_mjpeg_decode_sof(s) < 0)
93 93
            return -1;
......
100 100
    if (sos_offs)
101 101
    {
102 102
//        init_get_bits(&s->gb, buf+sos_offs, (buf_end - (buf+sos_offs))*8);
103
        init_get_bits(&s->gb, buf+sos_offs, field_size*8);
103
        init_get_bits(&s->gb, buf_ptr+sos_offs, field_size*8);
104 104
        s->mjpb_skiptosod = (sod_offs - sos_offs - show_bits(&s->gb, 16));
105 105
        s->start_code = SOS;
106 106
        ff_mjpeg_decode_sos(s);

Also available in: Unified diff