FIX: Use of invalid subtitle language pointer
commit86971f591cdf8bbde35958f90fe4bb4ad96db03f
authorToni Gundogdu <legatvs@gmail.com>
Thu, 28 Mar 2013 09:49:44 +0000 (28 11:49 +0200)
committerToni Gundogdu <legatvs@gmail.com>
Thu, 28 Mar 2013 11:04:50 +0000 (28 13:04 +0200)
treef1388e8cddf3a6a6e26cdf6f70dd6cca9340667f
parent7ea48277d8ba6ac80dff519992b150eaa0abe738
FIX: Use of invalid subtitle language pointer

Fixes the use of invalid (NULL) subtitle language pointer when libquvi
failed to find any subtitles for the media.

lutil_choose_subtitle: Check the returned language pointer
  quvi_subtitle_select may return NULL if libquvi failed to find any
  subtitle languages. If the 'fail_if_none' arg is TRUE, then croak.

quvi-dump: _foreach_subtitle_url:
  Pass 'fail_if_none' as TRUE to lutil_choose_subtitle.

quvi-get:
  * _dump_languages:
    - Print either 'none' or the found subtitle language IDs
  * _copy_subtitle:
    - Pass 'fail_if_none' as FALSE to lutil_choose_subtitle
    - Export only if language pointer != NULL

Signed-off-by: Toni Gundogdu <legatvs@gmail.com>
src/builtin/dump.c
src/builtin/get.c
src/util/choose.c
src/util/lutil.h