Revision e5986d04

View differences:

libavcodec/xan.c
140 140

  
141 141
                size = opcode & 3;
142 142

  
143
                back  = ((opcode & 0x60) << 3) + *src++ + 1;
143 144
                size2 = ((opcode & 0x1c) >> 2) + 3;
144
                back = ((opcode & 0x60) << 3) + *src++ + 1;
145 145

  
146 146
            } else if ( (opcode & 0x40) == 0 ) {
147 147

  
148 148
                size = *src >> 6;
149 149

  
150
                back  = (bytestream_get_be16(&src) & 0x3fff) + 1;
150 151
                size2 = (opcode & 0x3f) + 4;
151
                back = (bytestream_get_be16(&src) & 0x3fff) + 1;
152 152

  
153 153
            } else {
154 154

  
155 155
                size = opcode & 3;
156 156

  
157
                back = ((opcode & 0x10) << 12) + 1 + bytestream_get_be16(&src);
158
                size2 = *src++ + 5 + ((opcode & 0xc) << 6);
157
                back  = ((opcode & 0x10) << 12) + bytestream_get_be16(&src) + 1;
158
                size2 = ((opcode & 0x0c) <<  6) + *src++ + 5;
159 159
                if (size + size2 > dest_end - dest)
160 160
                    return;
161 161
            }

Also available in: Unified diff