Commit 95ce02b3 authored by Sean McGovern's avatar Sean McGovern

rmdec: don't ignore the return value of av_get_packet()

parent 825e463a
...@@ -722,6 +722,7 @@ ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb, ...@@ -722,6 +722,7 @@ ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb,
int *seq, int flags, int64_t timestamp) int *seq, int flags, int64_t timestamp)
{ {
RMDemuxContext *rm = s->priv_data; RMDemuxContext *rm = s->priv_data;
int ret;
if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
rm->current_stream= st->id; rm->current_stream= st->id;
...@@ -778,11 +779,15 @@ ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb, ...@@ -778,11 +779,15 @@ ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb,
} else } else
return -1; return -1;
} else { } else {
av_get_packet(pb, pkt, len); ret = av_get_packet(pb, pkt, len);
if (ret < 0)
return ret;
rm_ac3_swap_bytes(st, pkt); rm_ac3_swap_bytes(st, pkt);
} }
} else } else
av_get_packet(pb, pkt, len); ret = av_get_packet(pb, pkt, len);
if (ret < 0)
return ret;
pkt->stream_index = st->index; pkt->stream_index = st->index;
...@@ -798,14 +803,18 @@ ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb, ...@@ -798,14 +803,18 @@ ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,
AVStream *st, RMStream *ast, AVPacket *pkt) AVStream *st, RMStream *ast, AVPacket *pkt)
{ {
RMDemuxContext *rm = s->priv_data; RMDemuxContext *rm = s->priv_data;
int ret;
assert (rm->audio_pkt_cnt > 0); assert (rm->audio_pkt_cnt > 0);
if (ast->deint_id == DEINT_ID_VBRF || if (ast->deint_id == DEINT_ID_VBRF ||
ast->deint_id == DEINT_ID_VBRS) ast->deint_id == DEINT_ID_VBRS) {
av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]); ret = av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]);
if (ret < 0)
return ret;
}
else { else {
int ret = av_new_packet(pkt, st->codecpar->block_align); ret = av_new_packet(pkt, st->codecpar->block_align);
if (ret < 0) if (ret < 0)
return ret; return ret;
memcpy(pkt->data, ast->pkt.data + st->codecpar->block_align * //FIXME avoid this memcpy(pkt->data, ast->pkt.data + st->codecpar->block_align * //FIXME avoid this
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment