mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
avcodec/pthread: check packet buffer allocation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
eff2edae56
commit
841c0aafa5
@ -343,6 +343,10 @@ static int submit_packet(PerThreadContext *p, AVPacket *avpkt)
|
||||
p->avpkt.buf = av_buffer_ref(avpkt->buf);
|
||||
else {
|
||||
av_fast_malloc(&p->buf, &p->allocated_buf_size, avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!p->buf) {
|
||||
pthread_mutex_unlock(&p->mutex);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
p->avpkt.data = p->buf;
|
||||
memcpy(p->buf, avpkt->data, avpkt->size);
|
||||
memset(p->buf + avpkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
|
Loading…
Reference in New Issue
Block a user