aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-12-18 15:18:47 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-12-20 15:40:05 +0100
commit0f1e398874399ddf0586b54735d8c85ff1228c85 (patch)
tree6f8d2e8c1a3da3bb9152654fd2d711cd8e713bb1
parent79d75f1554de110d020a8035c86458a80dd7d773 (diff)
downloadffmpeg-0f1e398874399ddf0586b54735d8c85ff1228c85.tar.gz
nutdec: only copy the header if it exists
Fixes ubsan runtime error: null pointer passed as argument 2, which is declared to never be null Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commit 9f82506c79874edd7b09707ab63d9e72078de8f9) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r--libavformat/nutdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index cd1da9f13e..a28c632977 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -1069,7 +1069,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
if (stc->last_flags & FLAG_SM_DATA) {
int sm_size;