]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/jvdec.c
avformat/av1: Fix nits in the documentation of ff_av1_filter_obus_buf()
[ffmpeg] / libavformat / jvdec.c
index 17ada7b0f13181572f4c13395f10bb2966683f6b..551f8069e6b9a42989acc59da62c7122f260aaca 100644 (file)
@@ -168,6 +168,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
     JVDemuxContext *jv = s->priv_data;
     AVIOContext *pb = s->pb;
     AVStream *ast = s->streams[0];
+    int ret;
 
     while (!avio_feof(s->pb) && jv->pts < ast->nb_index_entries) {
         const AVIndexEntry *e   = ast->index_entries + jv->pts;
@@ -177,8 +178,8 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
         case JV_AUDIO:
             jv->state++;
             if (jvf->audio_size) {
-                if (av_get_packet(s->pb, pkt, jvf->audio_size) < 0)
-                    return AVERROR(ENOMEM);
+                if ((ret = av_get_packet(s->pb, pkt, jvf->audio_size)) < 0)
+                    return ret;
                 pkt->stream_index = 0;
                 pkt->pts          = e->timestamp;
                 pkt->flags       |= AV_PKT_FLAG_KEY;
@@ -187,10 +188,9 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
         case JV_VIDEO:
             jv->state++;
             if (jvf->video_size || jvf->palette_size) {
-                int ret;
                 int size = jvf->video_size + jvf->palette_size;
-                if (av_new_packet(pkt, size + JV_PREAMBLE_SIZE))
-                    return AVERROR(ENOMEM);
+                if ((ret = av_new_packet(pkt, size + JV_PREAMBLE_SIZE)) < 0)
+                    return ret;
 
                 AV_WL32(pkt->data, jvf->video_size);
                 pkt->data[4] = jvf->video_type;