1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

Check return value of avc_parse_nal_units().

Originally committed as revision 11495 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Aurelien Jacobs 2008-01-11 00:47:02 +00:00
parent f739b36d16
commit ed7fa39c2d

View File

@ -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) {