diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2008-01-11 00:47:02 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2008-01-11 00:47:02 +0000 |
commit | ed7fa39c2dd63607fd5c5ed3c607a11a8a33bbe3 (patch) | |
tree | 360a562b5a5db01f0bc37418f2dcf919ea7750d3 /libavformat | |
parent | f739b36d16bdfec4fd050f98dd3f66257daa0381 (diff) | |
download | ffmpeg-ed7fa39c2dd63607fd5c5ed3c607a11a8a33bbe3.tar.gz |
Check return value of avc_parse_nal_units().
Originally committed as revision 11495 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/movenc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 042c2b5d27..d67e9b5b96 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -488,7 +488,9 @@ static int mov_write_avcc_tag(ByteIOContext *pb, MOVTrack *track) 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 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt) 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) { |