diff mbox series

[FFmpeg-devel,v3,20/34] avdevice/avdevice: clean up avdevice_capabilities_create

Message ID 20210706092020.1057-21-dcnieho@gmail.com
State New
Headers show
Series avdevice (mostly dshow) enhancements
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Diederick C. Niehorster July 6, 2021, 9:20 a.m. UTC
Draw implementation in line with that of avdevice_list_devices

Signed-off-by: Diederick Niehorster <dcnieho@gmail.com>
---
 libavdevice/avdevice.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavdevice/avdevice.c b/libavdevice/avdevice.c
index 695b9143af..e66906e91b 100644
--- a/libavdevice/avdevice.c
+++ b/libavdevice/avdevice.c
@@ -100,11 +100,14 @@  int avdevice_capabilities_create(AVDeviceCapabilitiesQuery **caps, AVFormatConte
                                  AVDictionary **device_options)
 {
     int ret;
-    av_assert0(s && caps);
+    av_assert0(s);
+    av_assert0(caps);
     av_assert0(s->iformat || s->oformat);
     if ((s->oformat && !s->oformat->create_device_capabilities) ||
-        (s->iformat && !s->iformat->create_device_capabilities))
+        (s->iformat && !s->iformat->create_device_capabilities)) {
+        *caps = NULL;
         return AVERROR(ENOSYS);
+    }
     *caps = av_mallocz(sizeof(**caps));
     if (!(*caps))
         return AVERROR(ENOMEM);