mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-10-14 12:24:49 +02:00
avcodec/pthread_frame: Check av_packet_ref() for failure
Fixes CID1396242
This commit is contained in:
parent
e57fd926b0
commit
1e5cfad57e
@ -312,6 +312,7 @@ static int submit_packet(PerThreadContext *p, AVPacket *avpkt)
|
|||||||
FrameThreadContext *fctx = p->parent;
|
FrameThreadContext *fctx = p->parent;
|
||||||
PerThreadContext *prev_thread = fctx->prev_thread;
|
PerThreadContext *prev_thread = fctx->prev_thread;
|
||||||
const AVCodec *codec = p->avctx->codec;
|
const AVCodec *codec = p->avctx->codec;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (!avpkt->size && !(codec->capabilities & AV_CODEC_CAP_DELAY))
|
if (!avpkt->size && !(codec->capabilities & AV_CODEC_CAP_DELAY))
|
||||||
return 0;
|
return 0;
|
||||||
@ -337,7 +338,12 @@ static int submit_packet(PerThreadContext *p, AVPacket *avpkt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
av_packet_unref(&p->avpkt);
|
av_packet_unref(&p->avpkt);
|
||||||
av_packet_ref(&p->avpkt, avpkt);
|
ret = av_packet_ref(&p->avpkt, avpkt);
|
||||||
|
if (ret < 0) {
|
||||||
|
pthread_mutex_unlock(&p->mutex);
|
||||||
|
av_log(p->avctx, AV_LOG_ERROR, "av_packet_ref() failed in submit_packet()\n");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
p->state = STATE_SETTING_UP;
|
p->state = STATE_SETTING_UP;
|
||||||
pthread_cond_signal(&p->input_cond);
|
pthread_cond_signal(&p->input_cond);
|
||||||
|
Loading…
Reference in New Issue
Block a user