rmdec: fix null derefercne
Fixes CID733714 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
1bf5071104
commit
c01a462cda
@ -839,7 +839,8 @@ ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,
|
||||
ast->deint_id == DEINT_ID_VBRS)
|
||||
av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]);
|
||||
else {
|
||||
av_new_packet(pkt, st->codec->block_align);
|
||||
if(av_new_packet(pkt, st->codec->block_align) < 0)
|
||||
return AVERROR(ENOMEM);
|
||||
memcpy(pkt->data, ast->pkt.data + st->codec->block_align * //FIXME avoid this
|
||||
(ast->sub_packet_h * ast->audio_framesize / st->codec->block_align - rm->audio_pkt_cnt),
|
||||
st->codec->block_align);
|
||||
@ -867,7 +868,9 @@ static int rm_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
if (rm->audio_pkt_cnt) {
|
||||
// If there are queued audio packet return them first
|
||||
st = s->streams[rm->audio_stream_num];
|
||||
ff_rm_retrieve_cache(s, s->pb, st, st->priv_data, pkt);
|
||||
res = ff_rm_retrieve_cache(s, s->pb, st, st->priv_data, pkt);
|
||||
if(res < 0)
|
||||
return res;
|
||||
flags = 0;
|
||||
} else {
|
||||
if (rm->old_format) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user