~siretart/xine-lib/ubuntu

« back to all changes in this revision

Viewing changes to src/video_out/video_out_xshm.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2005-12-15 13:13:45 UTC
  • mfrom: (0.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051215131345-8n4osv1j7fy9c1s1
* SECURITY UPDATE: Fix arbitrary code execution with crafted PNG images in
  embedded ffmpeg copy.
* src/libffmpeg/libavcodec/utils.c, avcodec_default_get_buffer(): Apply
  upstream patch to fix buffer overflow on decoding of small PIX_FMT_PAL8
  PNG files.
* References:
  CVE-2005-4048
  http://mplayerhq.hu/pipermail/ffmpeg-devel/2005-November/005333.html
  http://www1.mplayerhq.hu/cgi-bin/cvsweb.cgi/ffmpeg/libavcodec/
  utils.c.diff?r1=1.161&r2=1.162&cvsroot=FFMpeg

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 * along with this program; if not, write to the Free Software
18
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
19
19
 *
20
 
 * $Id: video_out_xshm.c,v 1.138 2004/12/12 22:01:29 mroi Exp $
 
20
 * $Id: video_out_xshm.c,v 1.142 2005/09/25 00:44:04 miguelfreitas Exp $
21
21
 * 
22
22
 * video_out_xshm.c, X11 shared memory extension interface for xine
23
23
 *
61
61
*/
62
62
 
63
63
#include "xine_internal.h"
64
 
#include "alphablend.h"
65
64
#include "yuv2rgb.h"
66
65
#include "xineutils.h"
67
66
#include "vo_scale.h"
607
606
    }
608
607
    overlay->rgb_clut++;
609
608
  }
610
 
  if (!overlay->clip_rgb_clut) {
611
 
    clut = (clut_t*) overlay->clip_color;
 
609
  if (!overlay->hili_rgb_clut) {
 
610
    clut = (clut_t*) overlay->hili_color;
612
611
    for (i = 0; i < sizeof(overlay->color)/sizeof(overlay->color[0]); i++) {
613
612
      *((uint32_t *)&clut[i]) =
614
613
        frame->yuv2rgb->yuv2rgb_single_pixel_fun(frame->yuv2rgb,
615
614
                                                 clut[i].y, clut[i].cb, clut[i].cr);
616
615
    }
617
 
    overlay->clip_rgb_clut++;
 
616
    overlay->hili_rgb_clut++;
618
617
  }
619
618
}
620
619
 
629
628
    x11osd_clear(this->xoverlay); 
630
629
    XUnlockDisplay (this->display);
631
630
  }
 
631
  
 
632
  this->alphablend_extra_data.offset_x = frame_gen->overlay_offset_x;
 
633
  this->alphablend_extra_data.offset_y = frame_gen->overlay_offset_y;
632
634
}
633
635
 
634
636
static void xshm_overlay_end (vo_driver_t *this_gen, vo_frame_t *vo_img) {
657
659
        XUnlockDisplay (this->display);
658
660
      }
659
661
    } else {
660
 
      if (!overlay->rgb_clut || !overlay->clip_rgb_clut)
 
662
      if (!overlay->rgb_clut || !overlay->hili_rgb_clut)
661
663
        xshm_overlay_clut_yuv2rgb (this, overlay, frame);
662
664
 
663
665
      switch (this->bpp) {
664
666
        case 16:
665
 
         blend_rgb16 ((uint8_t *)frame->image->data, overlay,
 
667
         _x_blend_rgb16 ((uint8_t *)frame->image->data, overlay,
666
668
                      frame->sc.output_width, frame->sc.output_height,
667
669
                      frame->sc.delivered_width, frame->sc.delivered_height,
668
670
                      &this->alphablend_extra_data);
669
671
         break;
670
672
        case 24:
671
 
         blend_rgb24 ((uint8_t *)frame->image->data, overlay,
 
673
         _x_blend_rgb24 ((uint8_t *)frame->image->data, overlay,
672
674
                      frame->sc.output_width, frame->sc.output_height,
673
675
                      frame->sc.delivered_width, frame->sc.delivered_height,
674
676
                      &this->alphablend_extra_data);
675
677
         break;
676
678
        case 32:
677
 
         blend_rgb32 ((uint8_t *)frame->image->data, overlay,
 
679
         _x_blend_rgb32 ((uint8_t *)frame->image->data, overlay,
678
680
                      frame->sc.output_width, frame->sc.output_height,
679
681
                      frame->sc.delivered_width, frame->sc.delivered_height,
680
682
                      &this->alphablend_extra_data);
1236
1238
  
1237
1239
  this->yuv2rgb_mode  = mode;
1238
1240
  this->yuv2rgb_swap  = swapped;
1239
 
  this->yuv2rgb_brightness = config->register_range (config, "video.output.xshm_gamma", 0,
1240
 
                                                     -128, 127,
1241
 
                                                     _("brightness correction"),
1242
 
                                                     _("The brightness correction can be used to "
1243
 
                                                       "lighten or darken the image. It changes the "
1244
 
                                                       "blacklevel without modifying the contrast, "
1245
 
                                                       "but it limits the tonal range."),
1246
 
                                                     0, NULL, NULL);
1247
 
  this->yuv2rgb_contrast = 128;
 
1241
  this->yuv2rgb_brightness = 0;
 
1242
  this->yuv2rgb_contrast   = 128;
1248
1243
  this->yuv2rgb_saturation = 128;
1249
1244
  
1250
1245
  this->yuv2rgb_factory = yuv2rgb_factory_init (mode, swapped, 
1306
1301
 
1307
1302
plugin_info_t xine_plugin_info[] = {
1308
1303
  /* type, API, "name", version, special_info, init_function */  
1309
 
  { PLUGIN_VIDEO_OUT, 20, "xshm", XINE_VERSION_CODE, &vo_info_xshm, xshm_init_class },
 
1304
  { PLUGIN_VIDEO_OUT, 21, "xshm", XINE_VERSION_CODE, &vo_info_xshm, xshm_init_class },
1310
1305
  { PLUGIN_NONE, 0, "", 0, NULL, NULL }
1311
1306
};