~siretart/xine-lib/ubuntu

« back to all changes in this revision

Viewing changes to src/libffmpeg/libavcodec/sparc/dsputil_vis.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:
26
26
 
27
27
#include "config.h"
28
28
 
29
 
#if defined(ARCH_SPARC) && defined(ENABLE_VIS)
 
29
#ifdef ARCH_SPARC
30
30
 
31
31
#include <inttypes.h>
32
32
#include <signal.h>
3986
3986
 
3987
3987
/* End of no rounding code */
3988
3988
 
3989
 
void get_pixels_vis(uint8_t *restrict dest, const uint8_t *_ref, int stride)
3990
 
{
3991
 
  int i;
3992
 
  uint8_t *ref = (uint8_t*)_ref;
3993
 
  ref = vis_alignaddr(ref);
3994
 
 
3995
 
  for (i = 0; i < 8; i++)
3996
 
    {
3997
 
      vis_ld64(ref[0], TMP0);
3998
 
      vis_st64(TMP0, dest[0]);
3999
 
      dest += 8;
4000
 
      ref += stride;
4001
 
    }
4002
 
}
4003
 
 
4004
3989
static sigjmp_buf jmpbuf;
4005
3990
static volatile sig_atomic_t canjump = 0;
4006
3991
 
4010
3995
        signal (sig, SIG_DFL);
4011
3996
        raise (sig);
4012
3997
    }
4013
 
                                                                                
 
3998
 
4014
3999
    canjump = 0;
4015
4000
    siglongjmp (jmpbuf, 1);
4016
4001
}
4032
4017
 
4033
4018
    /* pdist %f0, %f0, %f0 */
4034
4019
    __asm__ __volatile__(".word\t0x81b007c0");
4035
 
                                                                                
 
4020
 
4036
4021
    canjump = 0;
4037
4022
    accel |= ACCEL_SPARC_VIS;
4038
 
                                                                                
 
4023
 
4039
4024
    if (sigsetjmp (jmpbuf, 1)) {
4040
4025
        signal (SIGILL, SIG_DFL);
4041
4026
        return accel;
4042
4027
    }
4043
 
                                                                                
 
4028
 
4044
4029
    canjump = 1;
4045
 
                                                                                
 
4030
 
4046
4031
    /* edge8n %g0, %g0, %g0 */
4047
4032
    __asm__ __volatile__(".word\t0x81b00020");
4048
 
                                                                                
 
4033
 
4049
4034
    canjump = 0;
4050
4035
    accel |= ACCEL_SPARC_VIS2;
4051
 
                                                                                
 
4036
 
4052
4037
    signal (SIGILL, SIG_DFL);
4053
4038
 
4054
4039
    return accel;
4061
4046
  int accel = vis_level ();
4062
4047
 
4063
4048
  if (accel & ACCEL_SPARC_VIS) {
4064
 
      c->get_pixels = get_pixels_vis;
4065
4049
      c->put_pixels_tab[0][0] = MC_put_o_16_vis;
4066
4050
      c->put_pixels_tab[0][1] = MC_put_x_16_vis;
4067
4051
      c->put_pixels_tab[0][2] = MC_put_y_16_vis;
4104
4088
  }
4105
4089
}
4106
4090
 
4107
 
#endif  /* defined(ARCH_SPARC) && defined(ENABLE_VIS) */
 
4091
#endif  /* !(ARCH_SPARC) */