History

avformat/rmdec: Fix potential crash on allocation failure

The RealMedia demuxer uses the priv_data of its streams to store a structure containing an AVPacket. These packets are unreferenced in the read_close function, yet said function simply presumed that the priv_data has been successfully allocated. This implies that it mustn't be called when an allocation of priv_data fails; but this can happen since commit 35bbc1955a58ba74552c50d9161084644f00bbd3 if one has a stream with multiple substreams (also exported as AVStream) and if allocating the priv_data for one of these substreams fails. This has been fixed by making sure that read_close can handle the case in which priv_data has not been successfully allocated.

Andreas Rheinhardt committed 6 years ago

Commit 5aafdb41 parent 4cc43d31 file · +3 −0Browse files

Unified · Split

libavformat/rmdec.c+3−0
@@ -115,6 +115,9 @@ RMStream *ff_rm_alloc_rmstream (void) · 114 unmodified lines
115 115
116void ff_rm_free_rmstream (RMStream *rms)116void ff_rm_free_rmstream (RMStream *rms)
117{117{
118 if (!rms)
119 return;
120
118 av_packet_unref(&rms->pkt);121 av_packet_unref(&rms->pkt);
119}122}
120 123

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