diff options
author | Alfred E. Heggestad <aeh@db.org> | 2015-08-16 22:04:03 +0200 |
---|---|---|
committer | Alfred E. Heggestad <aeh@db.org> | 2015-08-16 22:04:03 +0200 |
commit | 83cb94b340055689eabe911234e9e4aa80fbfc27 (patch) | |
tree | 3e9644986c7481fdce00060aef2e720b08a28ff5 /src | |
parent | 0535a3244acc2a6c096703090b467e60e630cf60 (diff) |
video: fix possible null deref (thanks to Tomasz Ostrowski)
Diffstat (limited to 'src')
-rw-r--r-- | src/video.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/video.c b/src/video.c index 86ac687..9e299fa 100644 --- a/src/video.c +++ b/src/video.c @@ -1065,14 +1065,18 @@ int video_decoder_set(struct video *v, struct vidcodec *vc, int pt_rx, /* handle vidcodecs without a decoder */ if (!vc->decupdh) { + struct vidcodec *vcd; + info("video: vidcodec '%s' has no decoder\n", vc->name); - vc = (struct vidcodec *)vidcodec_find_decoder(vc->name); - if (!vc) { + vcd = (struct vidcodec *)vidcodec_find_decoder(vc->name); + if (!vcd) { warning("video: could not find decoder (%s)\n", vc->name); return ENOENT; } + + vc = vcd; } vrx = &v->vrx; |