From: pabs Date: Sun, 11 Mar 2007 04:40:40 +0000 (+0000) Subject: Fix some error handling in mod_libavcodec. Still crashes though. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=c35ae74eae4e92c031b0fc5083af957ee485b990;p=synfig.git Fix some error handling in mod_libavcodec. Still crashes though. git-svn-id: http://svn.voria.com/code@286 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/modules/mod_libavcodec/trgt_av.cpp b/synfig-core/trunk/src/modules/mod_libavcodec/trgt_av.cpp index 7ceec6e..da8cfc6 100644 --- a/synfig-core/trunk/src/modules/mod_libavcodec/trgt_av.cpp +++ b/synfig-core/trunk/src/modules/mod_libavcodec/trgt_av.cpp @@ -416,8 +416,8 @@ public: //encode our given image size = avcodec_encode_video(context, &videobuffer[0], videobuffer.size(), pict); - //if not zero we've got stuff to write - if (size != 0) + //if greater than zero we've got stuff to write + if (size > 0) { av_init_packet(&pkt); pkt.stream_index = stream->index; @@ -431,7 +431,7 @@ public: ret = av_write_frame(formatc, &pkt); //error detect - possibly throw later... - if(ret != 0) + if(ret < 0) { synfig::warning("write_frame: error while writing video frame"); return false;