1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-13 21:28:01 +02:00

Merge commit '802713c4e7b41bc2deed754d78649945c3442063'

* commit '802713c4e7b41bc2deed754d78649945c3442063':
  mss2: prevent potential uninitialized reads
  mss2: reindent after last commit
  mss2: fix handling of unmasked implicit WMV9 rectangles
  configure: add lavu dependency to lavr/lavfi .pc files
  x86inc: Set program_name outside of x86inc.asm

Conflicts:
	configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-11-12 10:57:06 +01:00
commit da501ea857
4 changed files with 46 additions and 42 deletions

4
configure vendored
View File

@ -4417,7 +4417,7 @@ Cflags: -I\${includedir}
EOF EOF
} }
libavfilter_pc_deps="" libavfilter_pc_deps="libavutil = $LIBAVUTIL_VERSION"
enabled libavfilter_deps_avcodec && prepend libavfilter_pc_deps "libavcodec = $LIBAVCODEC_VERSION," enabled libavfilter_deps_avcodec && prepend libavfilter_pc_deps "libavcodec = $LIBAVCODEC_VERSION,"
enabled libavfilter_deps_avformat && prepend libavfilter_pc_deps "libavformat = $LIBAVFORMAT_VERSION," enabled libavfilter_deps_avformat && prepend libavfilter_pc_deps "libavformat = $LIBAVFORMAT_VERSION,"
enabled libavfilter_deps_swscale && prepend libavfilter_pc_deps "libswscale = $LIBSWSCALE_VERSION," enabled libavfilter_deps_swscale && prepend libavfilter_pc_deps "libswscale = $LIBSWSCALE_VERSION,"
@ -4434,7 +4434,7 @@ pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_V
pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$libavdevice_pc_deps" pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$libavdevice_pc_deps"
pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$libavfilter_pc_deps" pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$libavfilter_pc_deps"
pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil = $LIBAVUTIL_VERSION" pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs" pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION" pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
pkgconfig_generate libswresample "FFmpeg audio rescaling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION" pkgconfig_generate libswresample "FFmpeg audio rescaling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"

View File

@ -474,7 +474,7 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
int keyframe, has_wmv9, has_mv, is_rle, is_555, ret; int keyframe, has_wmv9, has_mv, is_rle, is_555, ret;
Rectangle wmv9rects[MAX_WMV9_RECTANGLES], *r; Rectangle wmv9rects[MAX_WMV9_RECTANGLES], *r;
int used_rects = 0, i, implicit_rect, av_uninit(wmv9_mask); int used_rects = 0, i, implicit_rect = 0, av_uninit(wmv9_mask);
av_assert0(FF_INPUT_BUFFER_PADDING_SIZE >= av_assert0(FF_INPUT_BUFFER_PADDING_SIZE >=
ARITH2_PADDING + (MIN_CACHE_BITS + 7) / 8); ARITH2_PADDING + (MIN_CACHE_BITS + 7) / 8);
@ -650,25 +650,6 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
buf_size -= bytestream2_tell(&gB); buf_size -= bytestream2_tell(&gB);
} else if (is_rle) {
init_get_bits(&gb, buf, buf_size * 8);
if (ret = decode_rle(&gb, c->pal_pic, c->pal_stride,
c->rgb_pic, c->rgb_stride, c->pal, keyframe,
ctx->split_position, 0,
avctx->width, avctx->height))
return ret;
align_get_bits(&gb);
if (c->slice_split)
if (ret = decode_rle(&gb, c->pal_pic, c->pal_stride,
c->rgb_pic, c->rgb_stride, c->pal, keyframe,
ctx->split_position, 1,
avctx->width, avctx->height))
return ret;
align_get_bits(&gb);
buf += get_bits_count(&gb) >> 3;
buf_size -= get_bits_count(&gb) >> 3;
} else { } else {
if (keyframe) { if (keyframe) {
c->corrupted = 0; c->corrupted = 0;
@ -676,32 +657,54 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
if (c->slice_split) if (c->slice_split)
ff_mss12_slicecontext_reset(&ctx->sc[1]); ff_mss12_slicecontext_reset(&ctx->sc[1]);
} }
else if (c->corrupted) if (is_rle) {
return AVERROR_INVALIDDATA; init_get_bits(&gb, buf, buf_size * 8);
bytestream2_init(&gB, buf, buf_size + ARITH2_PADDING); if (ret = decode_rle(&gb, c->pal_pic, c->pal_stride,
arith2_init(&acoder, &gB); c->rgb_pic, c->rgb_stride, c->pal, keyframe,
c->keyframe = keyframe; ctx->split_position, 0,
if (c->corrupted = ff_mss12_decode_rect(&ctx->sc[0], &acoder, 0, 0, avctx->width, avctx->height))
avctx->width, return ret;
ctx->split_position)) align_get_bits(&gb);
return AVERROR_INVALIDDATA;
buf += arith2_get_consumed_bytes(&acoder); if (c->slice_split)
buf_size -= arith2_get_consumed_bytes(&acoder); if (ret = decode_rle(&gb, c->pal_pic, c->pal_stride,
if (c->slice_split) { c->rgb_pic, c->rgb_stride, c->pal, keyframe,
if (buf_size < 1) ctx->split_position, 1,
avctx->width, avctx->height))
return ret;
align_get_bits(&gb);
buf += get_bits_count(&gb) >> 3;
buf_size -= get_bits_count(&gb) >> 3;
} else if (!implicit_rect || wmv9_mask != -1) {
if (c->corrupted)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
bytestream2_init(&gB, buf, buf_size + ARITH2_PADDING); bytestream2_init(&gB, buf, buf_size + ARITH2_PADDING);
arith2_init(&acoder, &gB); arith2_init(&acoder, &gB);
if (c->corrupted = ff_mss12_decode_rect(&ctx->sc[1], &acoder, 0, c->keyframe = keyframe;
ctx->split_position, if (c->corrupted = ff_mss12_decode_rect(&ctx->sc[0], &acoder, 0, 0,
avctx->width, avctx->width,
avctx->height - ctx->split_position)) ctx->split_position))
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
buf += arith2_get_consumed_bytes(&acoder); buf += arith2_get_consumed_bytes(&acoder);
buf_size -= arith2_get_consumed_bytes(&acoder); buf_size -= arith2_get_consumed_bytes(&acoder);
} if (c->slice_split) {
if (buf_size < 1)
return AVERROR_INVALIDDATA;
bytestream2_init(&gB, buf, buf_size + ARITH2_PADDING);
arith2_init(&acoder, &gB);
if (c->corrupted = ff_mss12_decode_rect(&ctx->sc[1], &acoder, 0,
ctx->split_position,
avctx->width,
avctx->height - ctx->split_position))
return AVERROR_INVALIDDATA;
buf += arith2_get_consumed_bytes(&acoder);
buf_size -= arith2_get_consumed_bytes(&acoder);
}
} else
memset(c->pal_pic, 0, c->pal_stride * avctx->height);
} }
if (has_wmv9) { if (has_wmv9) {
@ -836,8 +839,8 @@ static av_cold int mss2_decode_init(AVCodecContext *avctx)
if (ret = ff_mss12_decode_init(c, 1, &ctx->sc[0], &ctx->sc[1])) if (ret = ff_mss12_decode_init(c, 1, &ctx->sc[0], &ctx->sc[1]))
return ret; return ret;
c->pal_stride = c->mask_stride; c->pal_stride = c->mask_stride;
c->pal_pic = av_malloc(c->pal_stride * avctx->height); c->pal_pic = av_mallocz(c->pal_stride * avctx->height);
c->last_pal_pic = av_malloc(c->pal_stride * avctx->height); c->last_pal_pic = av_mallocz(c->pal_stride * avctx->height);
if (!c->pal_pic || !c->last_pal_pic) { if (!c->pal_pic || !c->last_pal_pic) {
mss2_decode_end(avctx); mss2_decode_end(avctx);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -35,7 +35,7 @@
; to x264-devel@videolan.org . ; to x264-devel@videolan.org .
%ifndef program_name %ifndef program_name
%define program_name ff %define program_name x264
%endif %endif
%define WIN64 0 %define WIN64 0

View File

@ -23,6 +23,7 @@
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;****************************************************************************** ;******************************************************************************
%define program_name ff
%define cpuflags_mmxext cpuflags_mmx2 %define cpuflags_mmxext cpuflags_mmx2
%include "libavutil/x86/x86inc.asm" %include "libavutil/x86/x86inc.asm"