[FFmpeg-cvslog] nutdec: check return value of av_new_packet()
Paul B Mahol
git at videolan.org
Mon Oct 15 19:05:29 CEST 2012
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Oct 15 15:20:40 2012 +0000| [bb502411ddb9fe1928d4a999693a3a49b83f8698] | committer: Paul B Mahol
nutdec: check return value of av_new_packet()
Fixes CID733173.
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bb502411ddb9fe1928d4a999693a3a49b83f8698
---
libavformat/nutdec.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index cc18adc..492d5c8 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -854,7 +854,8 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
return 1;
}
- av_new_packet(pkt, size + nut->header_len[header_idx]);
+ if (av_new_packet(pkt, size + nut->header_len[header_idx]) < 0)
+ return AVERROR(ENOMEM);
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);
More information about the ffmpeg-cvslog
mailing list