Commit 367d9b29 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  swscale: K&R formatting cosmetics (part II)
  tiffdec: Add a malloc check and refactor another.
  faxcompr: Check malloc results and unify return path
  configure: escape colons in values written to config.fate
  ac3dsp: call femms/emms at the end of float_to_fixed24() for 3DNow and SSE
  matroska: Fix leaking memory allocated for laces.
  pthread: Fix crash due to fctx->delaying not being cleared.
  vp3: Assert on invalid filter_limit values.
  h264: fix 10bit biweight functions after recent x86inc.asm fixes.
  ffv1: Fix size mismatch in encode_line.
  movenc: Remove a dead initialization
  git-howto: Explain how to avoid Windows line endings in git checkouts.
  build: Move all arch OBJS declarations into arch subdirectory Makefiles.

Conflicts:
	configure
	libavcodec/vp3.c
	libavformat/matroskadec.c
	libavutil/Makefile
	libswscale/Makefile
	libswscale/swscale.c
	libswscale/swscale_internal.h
	libswscale/utils.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 62e5ef95 ef0ee7f6
......@@ -2803,7 +2803,11 @@ case $target_os in
;;
esac
echo "config:$arch:$subarch:$cpu:$target_os:$cc_ident:$FFMPEG_CONFIGURATION" >config.fate
esc(){
echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
}
echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate
check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic
......
......@@ -65,6 +65,14 @@ git clone git@@source.ffmpeg.org:ffmpeg <target>
This will put the FFmpeg sources into the directory @var{<target>} and let
you push back your changes to the remote repository.
Make sure that you do not have Windows line endings in your checkouts,
otherwise you may experience spurious compilation failures. One way to
achieve this is to run
@example
git config --global core.autocrlf false
@end example
@section Updating the source tree to the latest revision
......
......@@ -275,12 +275,17 @@ int ff_ccitt_unpack(AVCodecContext *avctx,
{
int j;
GetBitContext gb;
int *runs, *ref, *runend;
int *runs, *ref = NULL, *runend;
int ret;
int runsize= avctx->width + 2;
int err = 0;
runs = av_malloc(runsize * sizeof(runs[0]));
ref = av_malloc(runsize * sizeof(ref[0]));
if (!runs || ! ref) {
err = AVERROR(ENOMEM);
goto fail;
}
ref[0] = avctx->width;
ref[1] = 0;
ref[2] = 0;
......@@ -290,9 +295,8 @@ int ff_ccitt_unpack(AVCodecContext *avctx,
if(compr == TIFF_G4){
ret = decode_group3_2d_line(avctx, &gb, avctx->width, runs, runend, ref);
if(ret < 0){
av_free(runs);
av_free(ref);
return -1;
err = -1;
goto fail;
}
}else{
int g3d1 = (compr == TIFF_G3) && !(opts & 1);
......@@ -313,7 +317,8 @@ int ff_ccitt_unpack(AVCodecContext *avctx,
}
dst += stride;
}
fail:
av_free(runs);
av_free(ref);
return 0;
return err;
}
......@@ -445,7 +445,7 @@ static inline int get_vlc_symbol(GetBitContext *gb, VlcState * const state, int
#if CONFIG_FFV1_ENCODER
static av_always_inline int encode_line(FFV1Context *s, int w,
int16_t *sample[2],
int16_t *sample[3],
int plane_index, int bits)
{
PlaneContext * const p= &s->plane[plane_index];
......
......@@ -145,13 +145,18 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t* dst, int stride, const uin
int c, line, pixels, code;
const uint8_t *ssrc = src;
int width = ((s->width * s->bpp) + 7) >> 3;
#if CONFIG_ZLIB
uint8_t *zbuf; unsigned long outlen;
if (size <= 0)
return AVERROR_INVALIDDATA;
#if CONFIG_ZLIB
if(s->compr == TIFF_DEFLATE || s->compr == TIFF_ADOBE_DEFLATE){
uint8_t *zbuf; unsigned long outlen;
int ret;
outlen = width * lines;
zbuf = av_malloc(outlen);
if (!zbuf)
return AVERROR(ENOMEM);
ret = tiff_uncompress(zbuf, &outlen, src, size);
if(ret != Z_OK){
av_log(s->avctx, AV_LOG_ERROR, "Uncompressing failed (%lu of %lu) with error %d\n", outlen, (unsigned long)width * lines, ret);
......@@ -180,11 +185,11 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t* dst, int stride, const uin
}
if(s->compr == TIFF_CCITT_RLE || s->compr == TIFF_G3 || s->compr == TIFF_G4){
int i, ret = 0;
uint8_t *src2 = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
uint8_t *src2 = av_malloc((unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE);
if(!src2 || (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE < (unsigned)size){
if (!src2) {
av_log(s->avctx, AV_LOG_ERROR, "Error allocating temporary buffer\n");
return -1;
return AVERROR(ENOMEM);
}
if(s->fax_opts & 2){
av_log(s->avctx, AV_LOG_ERROR, "Uncompressed fax mode is not supported (yet)\n");
......
......@@ -223,7 +223,8 @@ cglobal float_to_fixed24_3dnow, 3,3,0, dst, src, len
add dstq, 32
sub lend, 8
ja .loop
REP_RET
femms
RET
INIT_XMM
cglobal float_to_fixed24_sse, 3,3,3, dst, src, len
......@@ -247,7 +248,8 @@ cglobal float_to_fixed24_sse, 3,3,3, dst, src, len
add dstq, 32
sub lend, 8
ja .loop
REP_RET
emms
RET
INIT_XMM
cglobal float_to_fixed24_sse2, 3,3,9, dst, src, len
......
......@@ -155,7 +155,7 @@ WEIGHT_FUNC_HALF_MM sse4
%if ARCH_X86_32
DECLARE_REG_TMP 3
%else
DECLARE_REG_TMP 10
DECLARE_REG_TMP 7
%endif
%macro BIWEIGHT_PROLOGUE 0
......@@ -218,7 +218,7 @@ DECLARE_REG_TMP 10
%endmacro
%macro BIWEIGHT_FUNC_DBL 1
cglobal h264_biweight_16_10_%1
cglobal h264_biweight_16_10_%1, 0, 8, 8
BIWEIGHT_PROLOGUE
BIWEIGHT_SETUP %1
.nextrow
......@@ -238,7 +238,7 @@ BIWEIGHT_FUNC_DBL sse2
BIWEIGHT_FUNC_DBL sse4
%macro BIWEIGHT_FUNC 1
cglobal h264_biweight_8_10_%1
cglobal h264_biweight_8_10_%1, 0, 8, 8
BIWEIGHT_PROLOGUE
BIWEIGHT_SETUP %1
.nextrow
......@@ -256,7 +256,7 @@ BIWEIGHT_FUNC sse2
BIWEIGHT_FUNC sse4
%macro BIWEIGHT_FUNC_HALF 1
cglobal h264_biweight_4_10_%1
cglobal h264_biweight_4_10_%1, 0, 8, 8
BIWEIGHT_PROLOGUE
BIWEIGHT_SETUP %1
sar r3d, 1
......
......@@ -1940,8 +1940,8 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
if (size < cfs * h / 2) {
av_log(matroska->ctx, AV_LOG_ERROR,
"Corrupt int4 RM-style audio packet size\n");
av_free(lace_size);
return AVERROR_INVALIDDATA;
res = AVERROR_INVALIDDATA;
goto end;
}
for (x=0; x<h/2; x++)
memcpy(track->audio.buf+x*2*w+y*cfs,
......@@ -1950,16 +1950,16 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
if (size < w) {
av_log(matroska->ctx, AV_LOG_ERROR,
"Corrupt sipr RM-style audio packet size\n");
av_free(lace_size);
return AVERROR_INVALIDDATA;
res = AVERROR_INVALIDDATA;
goto end;
}
memcpy(track->audio.buf + y*w, data, w);
} else {
if (size < sps * w / sps) {
av_log(matroska->ctx, AV_LOG_ERROR,
"Corrupt generic RM-style audio packet size\n");
av_free(lace_size);
return AVERROR_INVALIDDATA;
res = AVERROR_INVALIDDATA;
goto end;
}
for (x=0; x<w/sps; x++)
memcpy(track->audio.buf+sps*(h*x+((h+1)/2)*(y&1)+(y>>1)), data+x*sps, sps);
......@@ -2049,6 +2049,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
}
}
end:
av_free(lace_size);
return res;
}
......
......@@ -939,7 +939,7 @@ static const AVCodecTag codec_3gp_tags[] = {
static int mov_find_codec_tag(AVFormatContext *s, MOVTrack *track)
{
int tag = track->enc->codec_tag;
int tag;
if (track->mode == MODE_MP4 || track->mode == MODE_PSP)
tag = mp4_get_codec_tag(s, track);
......
......@@ -79,9 +79,6 @@ OBJS = adler32.o \
tree.o \
utils.o \
OBJS-$(ARCH_PPC) += ppc/cpu.o
OBJS-$(ARCH_X86) += x86/cpu.o
TESTPROGS = adler32 aes avstring base64 bprint cpu crc des eval file fifo \
lfg lls md5 opt pca parseutils random_seed rational sha tree
TESTPROGS-$(HAVE_LZO1X_999_COMPRESS) += lzo
......
OBJS += ppc/cpu.o \
OBJS += x86/cpu.o \
......@@ -14,22 +14,4 @@ OBJS = input.o \
utils.o \
yuv2rgb.o \
OBJS-$(ARCH_BFIN) += bfin/internal_bfin.o \
bfin/swscale_bfin.o \
bfin/yuv2rgb_bfin.o
ALTIVEC-OBJS += ppc/swscale_altivec.o \
ppc/yuv2rgb_altivec.o \
ppc/yuv2yuv_altivec.o
MMX-OBJS += x86/rgb2rgb.o \
x86/swscale_mmx.o \
x86/yuv2rgb_mmx.o
VIS-OBJS += sparc/yuv2rgb_vis.o
YASM-OBJS += x86/input.o \
x86/output.o \
x86/scale.o
$(SUBDIR)x86/swscale_mmx.o: CFLAGS += $(NOREDZONE_FLAGS)
OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
TESTPROGS = colorspace swscale
OBJS += bfin/internal_bfin.o \
bfin/swscale_bfin.o \
bfin/yuv2rgb_bfin.o \
ALTIVEC-OBJS += ppc/swscale_altivec.o \
ppc/yuv2rgb_altivec.o \
ppc/yuv2yuv_altivec.o \
VIS-OBJS += sparc/yuv2rgb_vis.o \
This diff is collapsed.
......@@ -657,8 +657,8 @@ const char *sws_format_name(enum PixelFormat format);
(x)==PIX_FMT_GBR24P \
)
#define isALPHA(x) \
(av_pix_fmt_descriptors[x].nb_components == 2 || \
#define isALPHA(x) \
(av_pix_fmt_descriptors[x].nb_components == 2 || \
av_pix_fmt_descriptors[x].nb_components == 4)
#if 1
......@@ -677,7 +677,7 @@ const char *sws_format_name(enum PixelFormat format);
(x) == PIX_FMT_PAL8)
#endif
#define isPlanar(x) \
#define isPlanar(x) \
(av_pix_fmt_descriptors[x].nb_components >= 2 && \
(av_pix_fmt_descriptors[x].flags & PIX_FMT_PLANAR))
......@@ -689,7 +689,7 @@ const char *sws_format_name(enum PixelFormat format);
((av_pix_fmt_descriptors[x].flags & \
(PIX_FMT_PLANAR | PIX_FMT_RGB)) == (PIX_FMT_PLANAR | PIX_FMT_RGB))
#define usePal(x) ((av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL) || \
#define usePal(x) ((av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL) || \
(av_pix_fmt_descriptors[x].flags & PIX_FMT_PSEUDOPAL) || \
(x) == PIX_FMT_Y400A)
......
This diff is collapsed.
$(SUBDIR)x86/swscale_mmx.o: CFLAGS += $(NOREDZONE_FLAGS)
OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
MMX-OBJS += x86/rgb2rgb.o \
x86/swscale_mmx.o \
x86/yuv2rgb_mmx.o \
YASM-OBJS += x86/input.o \
x86/output.o \
x86/scale.o \
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment