summaryrefslogtreecommitdiff
path: root/libavformat/jvdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/jvdec.c')
-rw-r--r--libavformat/jvdec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/jvdec.c b/libavformat/jvdec.c
index 17ada7b0f1..551f8069e6 100644
--- a/libavformat/jvdec.c
+++ b/libavformat/jvdec.c
@@ -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;