From 545be54bdc7e0879cab0d5bb964816b88a354c72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Fri, 7 Dec 2007 15:21:39 +0100 Subject: Don't try to free the frame if it's not allocated. Fixes bug FS#3. --- src/libffmpeg/ff_video_decoder.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/libffmpeg/ff_video_decoder.c b/src/libffmpeg/ff_video_decoder.c index 8fc9cc8cb..1e32ad3a6 100644 --- a/src/libffmpeg/ff_video_decoder.c +++ b/src/libffmpeg/ff_video_decoder.c @@ -215,12 +215,14 @@ static void release_buffer(struct AVCodecContext *context, AVFrame *av_frame){ ff_video_decoder_t *this = (ff_video_decoder_t *)context->opaque; if (av_frame->type == FF_BUFFER_TYPE_USER) { - vo_frame_t *img = (vo_frame_t *)av_frame->opaque; + if ( av_frame->opaque ) { + vo_frame_t *img = (vo_frame_t *)av_frame->opaque; + + img->free(img); + } + xine_list_iterator_t it; - assert(av_frame->opaque); - img->free(img); - it = xine_list_find(this->dr1_frames, av_frame); assert(it); if( it != NULL ) -- cgit v1.2.3