Commit b6607559 authored by Benjamin Larsson's avatar Benjamin Larsson

Don't copy more then needed, bugfix by Gus Scheidt ellocogato at gmail dot com...

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
parent 615259a3
...@@ -242,7 +242,7 @@ static int flashsv_encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_siz ...@@ -242,7 +242,7 @@ static int flashsv_encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_siz
*p = *pict; *p = *pict;
if (s->first_frame) { 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) { if (!s->previous_frame) {
av_log(avctx, AV_LOG_ERROR, "Memory allocation failed.\n"); av_log(avctx, AV_LOG_ERROR, "Memory allocation failed.\n");
return -1; return -1;
...@@ -295,7 +295,7 @@ static int flashsv_encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_siz ...@@ -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); res = encode_bitstream(s, p, buf, buf_size, opt_w*16, opt_h*16, s->previous_frame, &I_frame);
#endif #endif
//save the current frame //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 //mark the frame type so the muxer can mux it correctly
if (I_frame) { if (I_frame) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment