summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-03-21 12:34:56 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-03-21 12:34:56 +0000
commite39616122c008ee817970bec66beea4a57c38663 (patch)
tree1ab11952db240b92cac6aca87300c832e0b0d27a /src
parent363b6dfbba372c20ac6ad3b6b18dc4340c5ce021 (diff)
downloadxine-lib-e39616122c008ee817970bec66beea4a57c38663.tar.gz
xine-lib-e39616122c008ee817970bec66beea4a57c38663.tar.bz2
should fix a bug reported by Chris Rankin. (frame used after being freed)
CVS patchset: 1603 CVS date: 2002/03/21 12:34:56
Diffstat (limited to 'src')
-rw-r--r--src/libmpeg2/decode.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c
index d84c9d2f2..d7245afaa 100644
--- a/src/libmpeg2/decode.c
+++ b/src/libmpeg2/decode.c
@@ -182,7 +182,12 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code,
picture->current_frame->pts = 0;
mpeg2dec->frames_to_drop = picture->current_frame->draw (picture->current_frame);
- picture->current_frame->free (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);
+
picture->current_frame = NULL;
picture->throwaway_frame = NULL;
} else if (picture->forward_reference_frame && !picture->forward_reference_frame->drawn) {