summaryrefslogtreecommitdiff
path: root/libavcodec/flashsvenc.c
diff options
context:
space:
mode:
authorBenjamin Larsson <banan@ludd.ltu.se>2007-01-25 08:21:02 +0000
committerBenjamin Larsson <banan@ludd.ltu.se>2007-01-25 08:21:02 +0000
commitb6607559af1a6a482025aedd6a2c132f39dc9f62 (patch)
treeb249a58cd656d2826f3bbd9c20ee984b6cd5a171 /libavcodec/flashsvenc.c
parent615259a33e364d1bad2e318ebd8e52f9b39ce2c0 (diff)
Don't copy more then needed, bugfix by Gus Scheidt ellocogato at gmail dot com and Michel Bardiaux mbardiaux at mediaxim dot be.
Originally committed as revision 7702 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/flashsvenc.c')
-rw-r--r--libavcodec/flashsvenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/flashsvenc.c b/libavcodec/flashsvenc.c
index 2683f0238e..80692eec73 100644
--- a/libavcodec/flashsvenc.c
+++ b/libavcodec/flashsvenc.c
@@ -242,7 +242,7 @@ static int flashsv_encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_siz
*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 @@ static int flashsv_encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_siz
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) {