History

rmdec: fix null derefercne

Fixes CID733714 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer committed 14 years ago

Commit c01a4621 parent 1bf50711 file · +5 −2Browse files

Unified · Split

libavformat/rmdec.c+5−2
@@ -839,7 +839,8 @@ ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb, · 838 unmodified lines
839839 ast->deint_id == DEINT_ID_VBRS)
840840 av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]);
841841 else {
842− av_new_packet(pkt, st->codec->block_align);
842+ if(av_new_packet(pkt, st->codec->block_align) < 0)
843+ return AVERROR(ENOMEM);
843844 memcpy(pkt->data, ast->pkt.data + st->codec->block_align * //FIXME avoid this
844845 (ast->sub_packet_h * ast->audio_framesize / st->codec->block_align - rm->audio_pkt_cnt),
845846 st->codec->block_align);
@@ -867,7 +868,9 @@ static int rm_read_packet(AVFormatContext *s, AVPacket *pkt) · 21 unmodified lines
867868 if (rm->audio_pkt_cnt) {
868869 // If there are queued audio packet return them first
869870 st = s->streams[rm->audio_stream_num];
870− ff_rm_retrieve_cache(s, s->pb, st, st->priv_data, pkt);
871+ res = ff_rm_retrieve_cache(s, s->pb, st, st->priv_data, pkt);
872+ if(res < 0)
873+ return res;
871874 flags = 0;
872875 } else {
873876 if (rm->old_format) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t