Skip to content
Snippets Groups Projects
Commit 34e484de authored by Marvin Scholz's avatar Marvin Scholz
Browse files

demos/plplay: fix null-deref

The av_pix_fmt_desc_get can return NULL which would cause a
NULL-pointer dereference for the has_alpha assignment.
parent 85f57ffb
No related branches found
No related tags found
1 merge request!123Minor plplay changes
......@@ -482,6 +482,9 @@ int main(int argc, char **argv)
const AVCodecParameters *par = p->stream->codecpar;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(par->format);
if (!desc)
goto error;
bool has_alpha = desc->flags & AV_PIX_FMT_FLAG_ALPHA;
if (!create_window(p, par->width, par->height, has_alpha))
goto error;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment