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 commit35bbc1955aif 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. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> (cherry picked from commit5aafdb4e5f)
This commit is contained in:
parent
7b4ff1a19a
commit
2d91ddd2df
1 changed files with 3 additions and 0 deletions
|
|
@ -115,6 +115,9 @@ RMStream *ff_rm_alloc_rmstream (void)
|
|||
|
||||
void ff_rm_free_rmstream (RMStream *rms)
|
||||
{
|
||||
if (!rms)
|
||||
return;
|
||||
|
||||
av_packet_unref(&rms->pkt);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue