Revision b6607559 libavcodec/flashsvenc.c

View differences:

libavcodec/flashsvenc.c
242 242
    *p = *pict;
243 243

  
244 244
    if (s->first_frame) {
245
        s->previous_frame = av_mallocz(p->linesize[0]*s->image_height*3);
245
        s->previous_frame = av_mallocz(p->linesize[0]*s->image_height);
246 246
        if (!s->previous_frame) {
247 247
            av_log(avctx, AV_LOG_ERROR, "Memory allocation failed.\n");
248 248
            return -1;
......
295 295
    res = encode_bitstream(s, p, buf, buf_size, opt_w*16, opt_h*16, s->previous_frame, &I_frame);
296 296
#endif
297 297
    //save the current frame
298
    memcpy(s->previous_frame, p->data[0], s->image_height*p->linesize[0]*3);
298
    memcpy(s->previous_frame, p->data[0], s->image_height*p->linesize[0]);
299 299

  
300 300
    //mark the frame type so the muxer can mux it correctly
301 301
    if (I_frame) {

Also available in: Unified diff