# HG changeset patch # User banan # Date 1169713262 0 # Node ID 548b2c0a2a51e90dacb2d7c63c5722a28b5f8e8d # Parent 48952197d91f0b568e7b36f0555a35d36b5b744c Don't copy more then needed, bugfix by Gus Scheidt ellocogato at gmail dot com and Michel Bardiaux mbardiaux at mediaxim dot be. diff -r 48952197d91f -r 548b2c0a2a51 flashsvenc.c --- a/flashsvenc.c Thu Jan 25 06:44:53 2007 +0000 +++ b/flashsvenc.c Thu Jan 25 08:21:02 2007 +0000 @@ -242,7 +242,7 @@ *p = *pict; if (s->first_frame) { - s->previous_frame = av_mallocz(p->linesize[0]*s->image_height*3); + s->previous_frame = av_mallocz(p->linesize[0]*s->image_height); if (!s->previous_frame) { av_log(avctx, AV_LOG_ERROR, "Memory allocation failed.\n"); return -1; @@ -295,7 +295,7 @@ res = encode_bitstream(s, p, buf, buf_size, opt_w*16, opt_h*16, s->previous_frame, &I_frame); #endif //save the current frame - memcpy(s->previous_frame, p->data[0], s->image_height*p->linesize[0]*3); + memcpy(s->previous_frame, p->data[0], s->image_height*p->linesize[0]); //mark the frame type so the muxer can mux it correctly if (I_frame) {