From 639bd610bfcb1a028b91a5c3d125045c8de6d8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Wed, 5 Apr 2006 22:12:17 +0000 Subject: 1) various warning fixes 2) [coverity] fixes: - 279 (w32): test should be on input parametr type, not typeW - 267 (aout): can be ignored but there was warning anyway - 234 (w32): missing free on error & exit - 152 (w32): missing free on error & exit - 148 (w32): fixed bound of static array in test - 101 (ffdec): defense code when avodec_encode_video will fail (just defense to the future, should never happen with current ffmpeg in xine) - 98, 99 (w32): check negative handle by _x_assert (it's used as index to array) - 90 (w32): negate pointer check (+added check for size) - 89 (w32): added NULL and size check CVS patchset: 7959 CVS date: 2006/04/05 22:12:17 --- src/libffmpeg/xine_encoder.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/libffmpeg') diff --git a/src/libffmpeg/xine_encoder.c b/src/libffmpeg/xine_encoder.c index e2fb95389..f2442f00d 100644 --- a/src/libffmpeg/xine_encoder.c +++ b/src/libffmpeg/xine_encoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_encoder.c,v 1.21 2005/05/06 04:22:51 tmmm Exp $ + * $Id: xine_encoder.c,v 1.22 2006/04/05 22:12:19 valtri Exp $ */ /* mpeg encoders for the dxr3 video out plugin. */ @@ -247,6 +247,12 @@ static int lavc_on_display_frame(dxr3_driver_t *drv, dxr3_frame_t *frame) frame->vo_frame.free(&frame->vo_frame); + if (size < 0) { + xprintf(drv->class->xine, XINE_VERBOSITY_LOG, + "dxr3_mpeg_encoder: encoding failed\n"); + return 0; + } + written = write(drv->fd_video, this->ffmpeg_buffer, size); if (written < 0) { xprintf(drv->class->xine, XINE_VERBOSITY_LOG, -- cgit v1.2.3