diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-10-20 14:11:19 +0100 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-01-13 00:01:33 +0100 |
commit | 1551602b423755c4ed98c5b7b2c2d6504416726e (patch) | |
tree | 0268b1fa4c6ef37f637f76028eb10325c932046c | |
parent | 4cd0041d38664adcb6f4b3038e277631b85d5dc8 (diff) | |
download | ffmpeg-1551602b423755c4ed98c5b7b2c2d6504416726e.tar.gz |
nutdec: check av_new_packet return value
CC: libav-stable@libav.org
Bug-Id: CID 733713
-rw-r--r-- | libavformat/nutdec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 6c95d5507b..36ca754fa1 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -822,7 +822,7 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code) { AVFormatContext *s = nut->avf; AVIOContext *bc = s->pb; - int size, stream_id, discard; + int size, stream_id, discard, ret; int64_t pts, last_IP_pts; StreamContext *stc; uint8_t header_idx; @@ -847,7 +847,9 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code) return 1; } - av_new_packet(pkt, size + nut->header_len[header_idx]); + ret = av_new_packet(pkt, size + nut->header_len[header_idx]); + if (ret < 0) + return ret; memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]); pkt->pos = avio_tell(bc); // FIXME avio_read(bc, pkt->data + nut->header_len[header_idx], size); |