]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpdec_mpa_robust.c
avcodec/codec, allcodecs: Constify the AVCodec API
[ffmpeg] / libavformat / rtpdec_mpa_robust.c
index f4716edf747b37573887a512508fc68bda6dae87..c0355edec2e273306ab63ab597c1df1eb885477b 100644 (file)
@@ -90,9 +90,9 @@ static int mpa_robust_parse_packet(AVFormatContext *ctx, PayloadContext *data,
             return AVERROR_INVALIDDATA;
         }
 
-        if (av_new_packet(pkt, adu_size)) {
+        if ((err = av_new_packet(pkt, adu_size)) < 0) {
             av_log(ctx, AV_LOG_ERROR, "Out of memory.\n");
-            return AVERROR(ENOMEM);
+            return err;
         }
 
         pkt->stream_index = st->index;
@@ -120,9 +120,9 @@ static int mpa_robust_parse_packet(AVFormatContext *ctx, PayloadContext *data,
     if (!continuation && adu_size <= len) {
         /* One or more complete frames */
 
-        if (av_new_packet(pkt, adu_size)) {
+        if ((err = av_new_packet(pkt, adu_size)) < 0) {
             av_log(ctx, AV_LOG_ERROR, "Out of memory.\n");
-            return AVERROR(ENOMEM);
+            return err;
         }
 
         pkt->stream_index = st->index;