X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Frtpdec_mpeg12.c;h=e640220ebee151f587213e588baf9950cf49b6c2;hb=e8fdb0db16c5ca8ad382b20874b4a454be6b79ae;hp=b93de3d9e4da678dd2280a483cf0eaa38a45510a;hpb=cb2205863b9505441956a459fffe7fed212ea54a;p=ffmpeg diff --git a/libavformat/rtpdec_mpeg12.c b/libavformat/rtpdec_mpeg12.c index b93de3d9e4d..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,14 +42,14 @@ 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; } -RTPDynamicProtocolHandler ff_mpeg_audio_dynamic_handler = { +const RTPDynamicProtocolHandler ff_mpeg_audio_dynamic_handler = { .codec_type = AVMEDIA_TYPE_AUDIO, .codec_id = AV_CODEC_ID_MP3, .need_parsing = AVSTREAM_PARSE_FULL, @@ -56,7 +57,7 @@ RTPDynamicProtocolHandler ff_mpeg_audio_dynamic_handler = { .static_payload_id = 14, }; -RTPDynamicProtocolHandler ff_mpeg_video_dynamic_handler = { +const RTPDynamicProtocolHandler ff_mpeg_video_dynamic_handler = { .codec_type = AVMEDIA_TYPE_VIDEO, .codec_id = AV_CODEC_ID_MPEG2VIDEO, .need_parsing = AVSTREAM_PARSE_FULL,