Commit 2acee08a authored by Michael Niedermayer's avatar Michael Niedermayer

avutil/frame: Copy size=0 side data in ff_init_buffer_info()

Fixes null pointer dereference
Fixes: 189/FOO

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 3c0328d5
...@@ -349,6 +349,7 @@ FF_ENABLE_DEPRECATION_WARNINGS ...@@ -349,6 +349,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
wipe_side_data(dst); wipe_side_data(dst);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
if (sd_src->buf) {
sd_dst->buf = av_buffer_ref(sd_src->buf); sd_dst->buf = av_buffer_ref(sd_src->buf);
if (!sd_dst->buf) { if (!sd_dst->buf) {
wipe_side_data(dst); wipe_side_data(dst);
...@@ -356,6 +357,7 @@ FF_ENABLE_DEPRECATION_WARNINGS ...@@ -356,6 +357,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
} }
sd_dst->data = sd_dst->buf->data; sd_dst->data = sd_dst->buf->data;
sd_dst->size = sd_dst->buf->size; sd_dst->size = sd_dst->buf->size;
}
} }
av_dict_copy(&sd_dst->metadata, sd_src->metadata, 0); av_dict_copy(&sd_dst->metadata, sd_src->metadata, 0);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment