diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2002-03-27 02:47:26 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2002-03-27 02:47:26 +0000 |
commit | 25305d0fadd6343a55c61194dd195670c1616399 (patch) | |
tree | d15475adf926175ab1044fae0ab82ad424005989 | |
parent | d02c9b5f961947aeecdd2d2dbe1571a796cf4fbc (diff) | |
download | xine-lib-25305d0fadd6343a55c61194dd195670c1616399.tar.gz xine-lib-25305d0fadd6343a55c61194dd195670c1616399.tar.bz2 |
fix frame buf leaks
CVS patchset: 1639
CVS date: 2002/03/27 02:47:26
-rw-r--r-- | src/libmpeg2/decode.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c index 866a7b1b0..4778fe55a 100644 --- a/src/libmpeg2/decode.c +++ b/src/libmpeg2/decode.c @@ -183,12 +183,14 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code, if (picture->mpeg1) picture->current_frame->pts = 0; - mpeg2dec->frames_to_drop = picture->current_frame->draw (picture->current_frame); + if( !picture->current_frame->drawn ) + mpeg2dec->frames_to_drop = picture->current_frame->draw (picture->current_frame); picture->current_frame->drawn = 1; - /* frame must not be freed if we still have a copy of it */ - if( picture->current_frame != picture->backward_reference_frame ) - picture->current_frame->free (picture->current_frame); + if( picture->current_frame == picture->backward_reference_frame ) + picture->backward_reference_frame = NULL; + + picture->current_frame->free (picture->current_frame); picture->current_frame = NULL; picture->throwaway_frame = NULL; |