diff --git a/cores/libretro-ffmpeg/packet_buffer.c b/cores/libretro-ffmpeg/packet_buffer.c index b852631b5c..da4cd4654c 100644 --- a/cores/libretro-ffmpeg/packet_buffer.c +++ b/cores/libretro-ffmpeg/packet_buffer.c @@ -16,7 +16,7 @@ struct packet_buffer packet_buffer_t *packet_buffer_create() { - packet_buffer_t *b = malloc(sizeof(packet_buffer_t)); + packet_buffer_t *b = (packet_buffer_t*)malloc(sizeof(packet_buffer_t)); if (!b) return NULL; diff --git a/cores/libretro-ffmpeg/video_buffer.c b/cores/libretro-ffmpeg/video_buffer.c index 72aeeaf560..d59354ae09 100644 --- a/cores/libretro-ffmpeg/video_buffer.c +++ b/cores/libretro-ffmpeg/video_buffer.c @@ -25,14 +25,14 @@ struct video_buffer video_buffer_t *video_buffer_create(size_t capacity, int frame_size, int width, int height) { - video_buffer_t *b = malloc(sizeof(video_buffer_t)); + video_buffer_t *b = (video_buffer_t*)malloc(sizeof(video_buffer_t)); if (!b) return NULL; memset(b, 0, sizeof(video_buffer_t)); b->capacity = capacity; - b->status = malloc(sizeof(enum kbStatus) * capacity); + b->status = (enum kbStatus*)malloc(sizeof(enum kbStatus) * capacity); if (!b->status) goto fail; for (int i = 0; i < capacity; i++) @@ -44,21 +44,21 @@ video_buffer_t *video_buffer_create(size_t capacity, int frame_size, int width, if (!b->lock || !b->open_cond || !b->finished_cond) goto fail; - b->buffer = malloc(sizeof(video_decoder_context_t) * capacity); + b->buffer = (video_decoder_context_t*)malloc(sizeof(video_decoder_context_t) * capacity); if (!b->buffer) goto fail; for (int i = 0; i < capacity; i++) { - b->buffer[i].index = i; - b->buffer[i].pts = 0; - b->buffer[i].sws = sws_alloc_context(); - b->buffer[i].source = av_frame_alloc(); + b->buffer[i].index = i; + b->buffer[i].pts = 0; + b->buffer[i].sws = sws_alloc_context(); + b->buffer[i].source = av_frame_alloc(); #if LIBAVUTIL_VERSION_MAJOR > 55 b->buffer[i].hw_source = av_frame_alloc(); #endif - b->buffer[i].target = av_frame_alloc(); - b->buffer[i].frame_buf = av_malloc(frame_size); + b->buffer[i].target = av_frame_alloc(); + b->buffer[i].frame_buf = (uint8_t*)av_malloc(frame_size); avpicture_fill((AVPicture*)b->buffer[i].target, (const uint8_t*)b->buffer[i].frame_buf, PIX_FMT_RGB32, width, height); diff --git a/libretro-common/rthreads/tpool.c b/libretro-common/rthreads/tpool.c index db3529222f..4856492155 100644 --- a/libretro-common/rthreads/tpool.c +++ b/libretro-common/rthreads/tpool.c @@ -101,8 +101,8 @@ static tpool_work_t *tpool_work_get(tpool_t *tp) static void tpool_worker(void *arg) { - tpool_t *tp = arg; - tpool_work_t *work; + tpool_work_t *work = NULL; + tpool_t *tp = (tpool_t*)arg; while (true) {