mirror of https://git.ffmpeg.org/ffmpeg.git
Merge commit '6bdae41d3ef74a0865e8f87896e649f93b2f39bd'
* commit '6bdae41d3ef74a0865e8f87896e649f93b2f39bd':
matroskadec: Check memory allocations
Conflicts:
libavformat/matroskadec.c
See: 3e2a5b33f0
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
b0112019f9
|
@ -2648,8 +2648,11 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska,
|
||||||
offset = 8;
|
offset = 8;
|
||||||
|
|
||||||
pkt = av_mallocz(sizeof(AVPacket));
|
pkt = av_mallocz(sizeof(AVPacket));
|
||||||
if (!pkt)
|
if (!pkt) {
|
||||||
|
if (pkt_data != data)
|
||||||
|
av_freep(&pkt_data);
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
}
|
||||||
/* XXX: prevent data copy... */
|
/* XXX: prevent data copy... */
|
||||||
if (av_new_packet(pkt, pkt_size + offset) < 0) {
|
if (av_new_packet(pkt, pkt_size + offset) < 0) {
|
||||||
av_free(pkt);
|
av_free(pkt);
|
||||||
|
|
Loading…
Reference in New Issue