aboutsummaryrefslogtreecommitdiffstats
path: root/libavdevice/avdevice.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-06 02:04:15 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-03-06 02:04:18 +0100
commitc832bf0c38a36698684971eca5f779d115b01976 (patch)
tree7f1d3016035c77fbcd7b71ca7d22697ab4d6d6ba /libavdevice/avdevice.c
parent636273d3d4a8c42f51832e8bf83e566e875916bf (diff)
parent2475fdbd047d8956b03f1bfb1e3f896985fd8c7f (diff)
downloadffmpeg-c832bf0c38a36698684971eca5f779d115b01976.tar.gz
Merge remote-tracking branch 'lukaszmluki/master'
* lukaszmluki/master: lavd/avdevice: always free detected devices on error lavf/http: return error from seek on invalid whence lavf/http: return error on seeking to negative postion lavf/avio: fix ffurl_alloc error checks Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice/avdevice.c')
-rw-r--r--libavdevice/avdevice.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavdevice/avdevice.c b/libavdevice/avdevice.c
index 8964b96f36..ea14c7a286 100644
--- a/libavdevice/avdevice.c
+++ b/libavdevice/avdevice.c
@@ -101,6 +101,7 @@ int avdevice_dev_to_app_control_message(struct AVFormatContext *s, enum AVDevToA
int avdevice_list_devices(AVFormatContext *s, AVDeviceInfoList **device_list)
{
+ int ret;
av_assert0(s);
av_assert0(device_list);
av_assert0(s->oformat || s->iformat);
@@ -113,8 +114,12 @@ int avdevice_list_devices(AVFormatContext *s, AVDeviceInfoList **device_list)
if (!(*device_list))
return AVERROR(ENOMEM);
if (s->oformat)
- return s->oformat->get_device_list(s, *device_list);
- return s->iformat->get_device_list(s, *device_list);
+ ret = s->oformat->get_device_list(s, *device_list);
+ else
+ ret = s->iformat->get_device_list(s, *device_list);
+ if (ret < 0)
+ avdevice_free_list_devices(device_list);
+ return ret;
}
void avdevice_free_list_devices(AVDeviceInfoList **device_list)