[xiph-commits] r14509 - trunk/ffmpeg2theora

conrad at svn.xiph.org conrad at svn.xiph.org
Thu Feb 14 03:53:49 PST 2008


Author: conrad
Date: 2008-02-14 03:53:48 -0800 (Thu, 14 Feb 2008)
New Revision: 14509

Modified:
   trunk/ffmpeg2theora/theorautils.c
Log:
add error checking on allocs in add_fis{head,bone}_packet() functions


Modified: trunk/ffmpeg2theora/theorautils.c
===================================================================
--- trunk/ffmpeg2theora/theorautils.c	2008-02-14 11:25:23 UTC (rev 14508)
+++ trunk/ffmpeg2theora/theorautils.c	2008-02-14 11:53:48 UTC (rev 14509)
@@ -73,6 +73,8 @@
     memset (&op, 0, sizeof (op));
 
     op.packet = _ogg_calloc (64, sizeof(unsigned char));
+    if (op.packet == NULL) return;
+
     memset (op.packet, 0, 64);
     memcpy (op.packet, FISHEAD_IDENTIFIER, 8); /* identifier */
     *((ogg_uint16_t*)(op.packet+8)) = SKELETON_VERSION_MAJOR; /* version major */
@@ -101,6 +103,8 @@
     if (!info->audio_only) {
         memset (&op, 0, sizeof (op));
         op.packet = _ogg_calloc (82, sizeof(unsigned char));
+        if (op.packet == NULL) return;
+
         memset (op.packet, 0, 82);
         /* it will be the fisbone packet for the theora video */
         memcpy (op.packet, FISBONE_IDENTIFIER, 8); /* identifier */
@@ -126,6 +130,8 @@
     if (!info->video_only) {
         memset (&op, 0, sizeof (op));
         op.packet = _ogg_calloc (82, sizeof(unsigned char));
+        if (op.packet == NULL) return;
+
         memset (op.packet, 0, 82);
         /* it will be the fisbone packet for the vorbis audio */
         memcpy (op.packet, FISBONE_IDENTIFIER, 8); /* identifier */



More information about the commits mailing list