X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Frtpdec_qdm2.c;h=a6a746becb48cb00728331377f98cc45968feab0;hb=c1e439d7e9abab3cebdc937636393b1656e095d9;hp=fa2b1b9302fbdd6e83001ff0ec694bb961de4931;hpb=ee96ab2db507b95a694f10b152481cf71842de28;p=ffmpeg diff --git a/libavformat/rtpdec_qdm2.c b/libavformat/rtpdec_qdm2.c index fa2b1b9302f..a6a746becb4 100644 --- a/libavformat/rtpdec_qdm2.c +++ b/libavformat/rtpdec_qdm2.c @@ -78,6 +78,7 @@ static int qdm2_parse_config(PayloadContext *qdm, AVStream *st, const uint8_t *buf, const uint8_t *end) { const uint8_t *p = buf; + int ret; while (end - p >= 2) { unsigned int item_len = p[0], config_item = p[1]; @@ -105,8 +106,9 @@ static int qdm2_parse_config(PayloadContext *qdm, AVStream *st, if (item_len < 30) return AVERROR_INVALIDDATA; av_freep(&st->codecpar->extradata); - if (ff_alloc_extradata(st->codecpar, 26 + item_len)) { - return AVERROR(ENOMEM); + ret = ff_alloc_extradata(st->codecpar, 26 + item_len); + if (ret < 0) { + return ret; } AV_WB32(st->codecpar->extradata, 12); memcpy(st->codecpar->extradata + 4, "frma", 4);