mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-23 11:39:49 +00:00
avformat/udp: add memory alloc checks
Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
This commit is contained in:
parent
f6eaa864f3
commit
5ef20244de
@ -903,6 +903,10 @@ static int udp_open(URLContext *h, const char *uri, int flags)
|
||||
if ((!is_output && s->circular_buffer_size) || (is_output && s->bitrate && s->circular_buffer_size)) {
|
||||
/* start the task going */
|
||||
s->fifo = av_fifo_alloc(s->circular_buffer_size);
|
||||
if (!s->fifo) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
ret = pthread_mutex_init(&s->mutex, NULL);
|
||||
if (ret != 0) {
|
||||
av_log(h, AV_LOG_ERROR, "pthread_mutex_init failed : %s\n", strerror(ret));
|
||||
|
Loading…
Reference in New Issue
Block a user