mirror of
https://github.com/mpv-player/mpv
synced 2025-04-11 04:01:31 +00:00
mp_image: check for malloc failure
Or rather, the only reason av_buffer_create() can fail is a malloc failure.
This commit is contained in:
parent
5b618ef629
commit
291ae3d659
@ -724,6 +724,8 @@ struct AVFrame *mp_image_to_av_frame_and_unref(struct mp_image *img)
|
||||
void *ptr = new_ref->planes[n];
|
||||
size_t size = new_ref->stride[n] * new_ref->h;
|
||||
frame->buf[n] = av_buffer_create(ptr, size, free_img, dummy_ref, flags);
|
||||
if (!frame->buf[n])
|
||||
abort();
|
||||
}
|
||||
talloc_free(new_ref);
|
||||
return frame;
|
||||
|
Loading…
Reference in New Issue
Block a user