# HG changeset patch # User reimar # Date 1334525835 0 # Node ID 48310248f8927da6df72bea00baa5f8e4f10b756 # Parent 9b8a830767f2f5b29eb790347acdcfb9919f7f26 Ensure that the highlight disappears when switching from DVD menu to playback. diff -r 9b8a830767f2 -r 48310248f892 sub/spudec.c --- a/sub/spudec.c Sun Apr 15 21:02:59 2012 +0000 +++ b/sub/spudec.c Sun Apr 15 21:37:15 2012 +0000 @@ -273,11 +273,17 @@ uint8_t *src; uint16_t pal[4]; unsigned stride = (crop_w + 7) & ~7; + int ret = 1; if (crop_x > this->pal_width || crop_y > this->pal_height || crop_w > this->pal_width - crop_x || crop_h > this->pal_width - crop_y || crop_w > 0x8000 || crop_h > 0x8000 || stride * crop_h > this->image_size) { - return 0; + // this might be an actual error or just signal that + // the highlight should be removed. + this->width = 0; + this->height = 0; + ret = 0; + goto out; } for (i = 0; i < 4; ++i) { int color; @@ -304,6 +310,7 @@ this->start_row = this->pal_start_row + crop_y; spudec_cut_image(this); +out: // reset scaled image this->scaled_frame_width = 0; this->scaled_frame_height = 0;