summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2011-04-21 18:47:22 +0000
committerphintuka <phintuka>2011-04-21 18:47:22 +0000
commit9174315b3aa9197910a1e1e17d69f8dbff403695 (patch)
tree1762ddd1b65abfb97f2283550060f51e92858730
parent6dce8433dca6f176af015490053cf12afdde2943 (diff)
downloadxineliboutput-9174315b3aa9197910a1e1e17d69f8dbff403695.tar.gz
xineliboutput-9174315b3aa9197910a1e1e17d69f8dbff403695.tar.bz2
Check if title_info is NULL before dereferencing it
-rw-r--r--xine/BluRay/input_bluray.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/xine/BluRay/input_bluray.c b/xine/BluRay/input_bluray.c
index 8ed05752..7346a0ed 100644
--- a/xine/BluRay/input_bluray.c
+++ b/xine/BluRay/input_bluray.c
@@ -205,13 +205,14 @@ static void overlay_proc(void *this_gen, const BD_OVERLAY * const ov)
static void update_stream_info(bluray_input_plugin_t *this)
{
- /* set stream info */
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_ANGLE_COUNT, this->title_info->angle_count);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_ANGLE_NUMBER, bd_get_current_angle(this->bdh));
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_CHAPTERS, this->title_info->chapter_count > 0);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_CHAPTER_COUNT, this->title_info->chapter_count);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_CHAPTER_NUMBER, bd_get_current_chapter(this->bdh) + 1);
+ if (this->title_info) {
+ /* set stream info */
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_ANGLE_COUNT, this->title_info->angle_count);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_ANGLE_NUMBER, bd_get_current_angle(this->bdh));
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_CHAPTERS, this->title_info->chapter_count > 0);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_CHAPTER_COUNT, this->title_info->chapter_count);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_CHAPTER_NUMBER, bd_get_current_chapter(this->bdh) + 1);
+ }
}
static void update_title_info(bluray_input_plugin_t *this, int playlist_id)
@@ -482,7 +483,7 @@ static void handle_libbluray_event(bluray_input_plugin_t *this, BD_EVENT ev)
case BD_EVENT_PLAYITEM:
lprintf("BD_EVENT_PLAYITEM %d\n", ev.param);
- if (ev.param < this->title_info->clip_count)
+ if (!this->title_info || ev.param < this->title_info->clip_count)
this->current_clip = ev.param;
else
this->current_clip = 0;