From 80265c6e80465990c4ec35feb72429be8ea35e10 Mon Sep 17 00:00:00 2001 From: uid45177 Date: Fri, 5 Jul 2002 21:12:32 +0000 Subject: checks to avoid segfaulting with (very) broken streams CVS patchset: 2217 CVS date: 2002/07/05 21:12:32 --- src/libmpeg2/decode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c index a8b48bb30..7c46f70f3 100644 --- a/src/libmpeg2/decode.c +++ b/src/libmpeg2/decode.c @@ -175,7 +175,7 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code, picture = mpeg2dec->picture; is_frame_done = mpeg2dec->in_slice && ((!code) || (code >= 0xb0)); - if (is_frame_done) { + if (is_frame_done && picture->current_frame != NULL) { mpeg2dec->in_slice = 0; if (((picture->picture_structure == FRAME_PICTURE) || @@ -402,7 +402,7 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code, } } - if (!(mpeg2dec->drop_frame)) { + if (!mpeg2dec->drop_frame && picture->current_frame != NULL) { mpeg2_slice (picture, code, buffer); if( picture->v_offset > picture->limit_y ) picture->current_frame->bad_frame = 0; -- cgit v1.2.3