rtpdec: check av_new_packet() return value
Fixes CID733715 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
3a8b66af6c
commit
c4503a2e40
@ -560,7 +560,8 @@ static int rtp_parse_packet_internal(RTPDemuxContext *s, AVPacket *pkt,
|
|||||||
h = AV_RB32(buf);
|
h = AV_RB32(buf);
|
||||||
len -= 4;
|
len -= 4;
|
||||||
buf += 4;
|
buf += 4;
|
||||||
av_new_packet(pkt, len);
|
if (av_new_packet(pkt, len) < 0)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
memcpy(pkt->data, buf, len);
|
memcpy(pkt->data, buf, len);
|
||||||
break;
|
break;
|
||||||
case AV_CODEC_ID_MPEG1VIDEO:
|
case AV_CODEC_ID_MPEG1VIDEO:
|
||||||
@ -578,11 +579,13 @@ static int rtp_parse_packet_internal(RTPDemuxContext *s, AVPacket *pkt,
|
|||||||
buf += 4;
|
buf += 4;
|
||||||
len -= 4;
|
len -= 4;
|
||||||
}
|
}
|
||||||
av_new_packet(pkt, len);
|
if (av_new_packet(pkt, len) < 0)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
memcpy(pkt->data, buf, len);
|
memcpy(pkt->data, buf, len);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
av_new_packet(pkt, len);
|
if (av_new_packet(pkt, len) < 0)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
memcpy(pkt->data, buf, len);
|
memcpy(pkt->data, buf, len);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user