X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Frtpdec_mpeg12.c;h=e640220ebee151f587213e588baf9950cf49b6c2;hb=4236e87f502e68acb949ea4ae6f5ebd889377b60;hp=43d9d5854c4a979c291f6c813482a8d891520075;hpb=a024c3ce9a502849013a4aa2c0a6de0c9270261c;p=ffmpeg diff --git a/libavformat/rtpdec_mpeg12.c b/libavformat/rtpdec_mpeg12.c index 43d9d5854c4..e640220ebee 100644 --- a/libavformat/rtpdec_mpeg12.c +++ b/libavformat/rtpdec_mpeg12.c @@ -29,6 +29,7 @@ static int mpeg_parse_packet(AVFormatContext *ctx, PayloadContext *data, int flags) { unsigned int h; + int ret; if (len <= 4) return AVERROR_INVALIDDATA; h = AV_RB32(buf); @@ -41,8 +42,8 @@ static int mpeg_parse_packet(AVFormatContext *ctx, PayloadContext *data, buf += 4; len -= 4; } - if (av_new_packet(pkt, len) < 0) - return AVERROR(ENOMEM); + if ((ret = av_new_packet(pkt, len)) < 0) + return ret; memcpy(pkt->data, buf, len); pkt->stream_index = st->index; return 0;