summaryrefslogtreecommitdiffstats
path: root/libhb/common.c
diff options
context:
space:
mode:
authorsaintdev <[email protected]>2008-04-18 01:57:47 +0000
committersaintdev <[email protected]>2008-04-18 01:57:47 +0000
commit245cc29464469372ac1e469ab7c93e5d7022e56b (patch)
tree4592bfb2ee7d939fb83851c45fdaeecd0ff5758c /libhb/common.c
parent7ca2df951032b46fe2c7beba2e509d129d860cf2 (diff)
Handle the case where hb_list_audio_config_item is passed an invalid index.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1429 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/common.c')
-rw-r--r--libhb/common.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libhb/common.c b/libhb/common.c
index 97d84ff60..00810dd79 100644
--- a/libhb/common.c
+++ b/libhb/common.c
@@ -739,8 +739,10 @@ int hb_audio_add(const hb_job_t * job, const hb_audio_config_t * audiocfg)
hb_audio_config_t * hb_list_audio_config_item(hb_list_t * list, int i)
{
assert(list != NULL);
+ hb_audio_t *audio = NULL;
- hb_audio_t *audio = hb_list_item(list, i);
+ if( (audio = hb_list_item(list, i)) )
+ return &(audio->config);
- return &(audio->config);
+ return NULL;
}