changeset 2919:e70dc14a3f9f libavformat

Check return value of avc_parse_nal_units().
author aurel
date Fri, 11 Jan 2008 00:47:02 +0000
parents 9e85e46922b5
children 5f15ed0f5fdc
files movenc.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/movenc.c	Thu Jan 10 13:54:30 2008 +0000
+++ b/movenc.c	Fri Jan 11 00:47:02 2008 +0000
@@ -488,7 +488,9 @@
             uint32_t sps_size=0, pps_size=0;
             uint8_t *sps=0, *pps=0;
 
-            avc_parse_nal_units(&track->vosData, &track->vosLen);
+            int ret = avc_parse_nal_units(&track->vosData, &track->vosLen);
+            if (ret < 0)
+                return ret;
             buf = track->vosData;
             end = track->vosData + track->vosLen;
 
@@ -1635,7 +1637,9 @@
     if (enc->codec_id == CODEC_ID_H264 && trk->vosLen > 0 && *(uint8_t *)trk->vosData != 1) {
         /* from x264 or from bytestream h264 */
         /* nal reformating needed */
-        avc_parse_nal_units(&pkt->data, &pkt->size);
+        int ret = avc_parse_nal_units(&pkt->data, &pkt->size);
+        if (ret < 0)
+            return ret;
         assert(pkt->size);
         size = pkt->size;
     } else if (enc->codec_id == CODEC_ID_DNXHD && !trk->vosLen) {