mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-17 20:17:55 +02:00
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)
|
ast->deint_id == DEINT_ID_VBRS)
|
||||||
av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]);
|
av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]);
|
||||||
else {
|
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
|
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),
|
(ast->sub_packet_h * ast->audio_framesize / st->codec->block_align - rm->audio_pkt_cnt),
|
||||||
st->codec->block_align);
|
st->codec->block_align);
|
||||||
@ -867,7 +868,9 @@ static int rm_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
if (rm->audio_pkt_cnt) {
|
if (rm->audio_pkt_cnt) {
|
||||||
// If there are queued audio packet return them first
|
// If there are queued audio packet return them first
|
||||||
st = s->streams[rm->audio_stream_num];
|
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;
|
flags = 0;
|
||||||
} else {
|
} else {
|
||||||
if (rm->old_format) {
|
if (rm->old_format) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user