~siretart/xine-lib/ubuntu

« back to all changes in this revision

Viewing changes to src/post/deinterlace/xine_plugin.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: xine_plugin.c,v 1.37 2004/09/29 18:30:37 miguelfreitas Exp $
 
20
 * $Id: xine_plugin.c,v 1.46 2005/09/19 16:14:02 valtri Exp $
21
21
 *
22
22
 * advanced video deinterlacer plugin
23
23
 * Jun/2003 by Miguel Freitas
32
32
#include "xine_internal.h"
33
33
#include "post.h"
34
34
#include "xineutils.h"
 
35
#include "xine_buffer.h"
35
36
#include <pthread.h>
36
37
 
37
38
#include "tvtime.h"
60
61
static char *enum_pulldown[] = { "none", "vektor", NULL };
61
62
static char *enum_framerate[] = { "full", "half_top", "half_bottom", NULL };
62
63
 
 
64
static void *help_string;
 
65
 
63
66
/*
64
67
 * this is the struct used by "parameters api" 
65
68
 */
196
199
  return &param_descr;
197
200
}
198
201
 
199
 
static char * get_help (void) {
 
202
static char * get_static_help (void) {
200
203
  return _("Advanced tvtime/deinterlacer plugin with pulldown detection\n"
201
204
           "This plugin aims to provide deinterlacing mechanisms comparable "
202
205
           "to high quality progressive DVD players and so called "
244
247
           "systems to try deinterlace algorithms, in a tradeoff between quality "
245
248
           "and cpu usage.\n"
246
249
           "\n"
 
250
           "* Uses several algorithms from tvtime and dscaler projects.\n"
247
251
           "Deinterlacing methods: (Not all methods are available for all plataforms)\n"
248
252
           "\n"
249
 
           "(FIXME: explain each method, check tvtime/dscaler docs... i fell lazy)\n"
250
 
           "\n"
251
 
           "* Uses several algorithms from tvtime and dscaler projects.\n"
252
253
           );
253
254
}
254
255
 
 
256
static char * get_help (void) {
 
257
  return (char *)help_string;
 
258
}
 
259
 
255
260
static xine_post_api_t post_api = {
256
261
  set_parameters,
257
262
  get_parameters,
302
307
 
303
308
  setup_speedy_calls(xine_mm_accel(),0);
304
309
 
305
 
  linear_plugin_init();
306
 
  linearblend_plugin_init();
307
 
  greedy_plugin_init();
308
 
  greedy2frame_plugin_init();
309
 
  weave_plugin_init();
310
 
  double_plugin_init();
311
 
  vfir_plugin_init();
312
 
 
313
 
  scalerbob_plugin_init();
314
 
 
315
 
  /*
316
 
  dscaler_greedyh_plugin_init();
317
 
  dscaler_twoframe_plugin_init();
318
 
 
319
 
  dscaler_videobob_plugin_init();
320
 
  dscaler_videoweave_plugin_init();
321
 
  dscaler_tomsmocomp_plugin_init();
322
 
  */
 
310
  register_deinterlace_method( linear_get_method() );
 
311
  register_deinterlace_method( linearblend_get_method() );
 
312
  register_deinterlace_method( greedy_get_method() );
 
313
  register_deinterlace_method( greedy2frame_get_method() );
 
314
  register_deinterlace_method( weave_get_method() );
 
315
  register_deinterlace_method( double_get_method() );
 
316
  register_deinterlace_method( vfir_get_method() );
 
317
  register_deinterlace_method( scalerbob_get_method() );
 
318
  register_deinterlace_method( dscaler_greedyh_get_method() );
 
319
  register_deinterlace_method( dscaler_tomsmocomp_get_method() );
 
320
 
323
321
  filter_deinterlace_methods( config_flags, 5 /*fieldsavailable*/ );
324
322
  if( !get_num_deinterlace_methods() ) {
325
323
      xprintf(xine, XINE_VERBOSITY_LOG, 
327
325
      return NULL;
328
326
  }
329
327
 
 
328
  help_string = xine_buffer_init(1024);
 
329
  xine_buffer_strcat( help_string, get_static_help() );
 
330
 
330
331
  enum_methods[0] = "use_vo_driver";
331
332
  for(i = 0; i < get_num_deinterlace_methods(); i++ ) {
332
 
    enum_methods[i+1] = (char *)get_deinterlace_method(i)->short_name;
 
333
    int j, desc_len;
 
334
    deinterlace_method_t *method;
 
335
 
 
336
    method = get_deinterlace_method(i);
 
337
    
 
338
    enum_methods[i+1] = (char *)method->short_name;
 
339
    xine_buffer_strcat( help_string, "[" );
 
340
    xine_buffer_strcat( help_string, (char *)method->short_name );
 
341
    xine_buffer_strcat( help_string, "] " );
 
342
    xine_buffer_strcat( help_string, (char *)method->name );
 
343
    xine_buffer_strcat( help_string, ":\n" );
 
344
 
 
345
    desc_len = 0;
 
346
    for(j = 0; j < sizeof(method->description)/sizeof(method->description[0]); j++ ) {
 
347
      if( strlen(method->description[j]) )
 
348
        desc_len = j+1;
 
349
    }
 
350
 
 
351
    for(j = 0; j < desc_len; j++ ) {
 
352
      xine_buffer_strcat( help_string, (char *)method->description[j] );
 
353
      xine_buffer_strcat( help_string, "\n" );
 
354
    }
 
355
    xine_buffer_strcat( help_string, "---\n" );
333
356
  }
334
357
  enum_methods[i+1] = NULL;
335
 
 
 
358
  
336
359
 
337
360
  /* Some default values */
338
361
  class->init_param.method                     = 1; /* First (plugin) method available */
411
434
 
412
435
static void deinterlace_class_dispose(post_class_t *class_gen)
413
436
{
 
437
  xine_buffer_free(help_string);
414
438
  free(class_gen);
415
439
}
416
440
 
421
445
 
422
446
  if (_x_post_dispose(this_gen)) {
423
447
    _flush_frames(this);
 
448
    pthread_mutex_destroy(&this->lock);
424
449
    free(this);
425
450
  }
426
451
}
550
575
  int force24fps;
551
576
            
552
577
  force24fps = this->judder_correction && !this->cheap_mode &&
553
 
               ( (this->pulldown == PULLDOWN_DALIAS) ||
554
 
                 (this->pulldown == PULLDOWN_VEKTOR && this->tvtime->filmmode) );
 
578
               ( this->pulldown == PULLDOWN_VEKTOR && this->tvtime->filmmode );
555
579
  
556
580
  if( this->tvtime->curmethod->doscalerbob ) {
557
581
    scaler = 2;
562
586
    frame->width, frame->height / scaler, frame->ratio, yuy2_frame->format,
563
587
    frame->flags | VO_BOTH_FIELDS);
564
588
  pthread_mutex_lock (&this->lock);
565
 
    
 
589
 
 
590
  deinterlaced_frame->crop_left   = frame->crop_left;
 
591
  deinterlaced_frame->crop_right  = frame->crop_right;
 
592
  deinterlaced_frame->crop_top    = frame->crop_top;
 
593
  deinterlaced_frame->crop_bottom = frame->crop_bottom;
 
594
 
566
595
  _x_extra_info_merge(deinterlaced_frame->extra_info, frame->extra_info);
567
596
    
568
597
  if( skip > 0 && !this->pulldown ) {