mp_image_tool: guard hw downloading against allocation failures

Small oversight, matters for OOM errors.
This commit is contained in:
wm4
2017-02-07 17:06:20 +01:00
parent 96a45a16af
commit 6d236bd96e

View File

@@ -301,7 +301,7 @@ struct mp_image *mp_image_hw_download(struct mp_image *src,
av_frame_unref(srcav);
dst = mp_image_from_av_frame(dstav);
av_frame_unref(dstav);
if (res >= 0) {
if (res >= 0 && dst) {
mp_image_set_size(dst, src->w, src->h);
mp_image_copy_attributes(dst, src);
} else {