mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
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>
This commit is contained in:
parent
5b88d24f24
commit
7f320ed15d
@ -1126,6 +1126,7 @@ 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;
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user