summaryrefslogtreecommitdiff
path: root/libavformat/nutdec.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>2015-12-18 17:24:09 +0100
committerAnton Khirnov <anton@khirnov.net>2016-01-13 09:44:44 +0100
commit9cdddb93bb33c58a5d42239326bc5eae0067366a (patch)
treebae854be9d4d776eb7572cfacc3e29df0955eef0 /libavformat/nutdec.c
parent8431629dd112874293380a6d8a852459fc1a76b6 (diff)
nutdec: only copy the header if it exists
Fixes runtime error: null pointer passed as argument 2, which is declared to never be null Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/nutdec.c')
-rw-r--r--libavformat/nutdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 17ae522533..e39f7d3e54 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -890,7 +890,8 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
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]);
+ if (nut->header[header_idx])
+ 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);