mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +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 9f82506c79
)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
parent
5b88d24f24
commit
7f320ed15d
@ -1126,7 +1126,8 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
|
|||||||
ret = av_new_packet(pkt, size + nut->header_len[header_idx]);
|
ret = av_new_packet(pkt, size + nut->header_len[header_idx]);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
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
|
pkt->pos = avio_tell(bc); // FIXME
|
||||||
if (stc->last_flags & FLAG_SM_DATA) {
|
if (stc->last_flags & FLAG_SM_DATA) {
|
||||||
int sm_size;
|
int sm_size;
|
||||||
|
Loading…
Reference in New Issue
Block a user