From e20c40697cb6b40804acac9a92005779382c6e7e Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 6 May 2003 20:43:37 +0000 Subject: release buffer cleanup Originally committed as revision 1839 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/cyuv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libavcodec/cyuv.c') diff --git a/libavcodec/cyuv.c b/libavcodec/cyuv.c index 1bf676a434..267f7c2303 100644 --- a/libavcodec/cyuv.c +++ b/libavcodec/cyuv.c @@ -98,6 +98,9 @@ static int cyuv_decode_frame(AVCodecContext *avctx, /* pixel data starts 48 bytes in, after 3x16-byte tables */ stream_ptr = 48; + if(s->frame.data[0]) + avctx->release_buffer(avctx, &s->frame); + s->frame.reference = 0; if(avctx->get_buffer(avctx, &s->frame) < 0) { fprintf(stderr, "get_buffer() failed\n"); @@ -159,8 +162,6 @@ static int cyuv_decode_frame(AVCodecContext *avctx, *data_size=sizeof(AVFrame); *(AVFrame*)data= s->frame; - avctx->release_buffer(avctx, &s->frame); - return buf_size; } -- cgit v1.2.3