From: Wim Taymans Date: Tue, 11 Dec 2012 09:22:34 +0000 (+0100) Subject: Revert "avviddec: Fix memory leaks and assertions in error cases if we can't allocate... X-Git-Tag: 1.1.1~69 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=76b8b8c67f7c8fdf03d8d7d5c98b1e5fb83f50e0;p=platform%2Fupstream%2Fgst-libav.git Revert "avviddec: Fix memory leaks and assertions in error cases if we can't allocate a frame" This reverts commit 47647e1caca117ff8a62caf8bf0b6c94eb6dd025. Breaks playback when direct rendering is disabled. The reason is that we set the opaque vaue to NULL and then try to use the NULL value when we decoded a frame. --- diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c index a53ecfb..29d7e72 100644 --- a/ext/libav/gstavviddec.c +++ b/ext/libav/gstavviddec.c @@ -485,7 +485,7 @@ static int gst_ffmpegviddec_get_buffer (AVCodecContext * context, AVFrame * picture) { GstVideoCodecFrame *frame; - GstFFMpegVidDecVideoFrame *dframe = NULL; + GstFFMpegVidDecVideoFrame *dframe; GstFFMpegVidDec *ffmpegdec; gint c; GstVideoInfo *info; @@ -583,10 +583,6 @@ invalid_frame: } fallback: { - if (dframe) - gst_ffmpegviddec_video_frame_free (dframe); - picture->opaque = NULL; - return avcodec_default_get_buffer (context, picture); } duplicate_frame: @@ -673,8 +669,7 @@ gst_ffmpegviddec_release_buffer (AVCodecContext * context, AVFrame * picture) /* we remove the opaque data now */ picture->opaque = NULL; - if (frame) - gst_ffmpegviddec_video_frame_free (frame); + gst_ffmpegviddec_video_frame_free (frame); /* zero out the reference in ffmpeg */ for (i = 0; i < 4; i++) {