1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  doc: Improve suggested Emacs settings for our coding style.
  utvideo: Remove unused variable 'src_size'
  mov: free memory on header parsing failure
  mov: fix leaking memory with multiple drefs.
  swscale: clip before assigning tables in RGB output functions.
  swscale: fix off-by-one in second coefficient in bilinear filters.

Conflicts:
	libavformat/mov.c
	libswscale/output.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2012-04-15 22:27:20 +02:00
3 changed files with 19 additions and 11 deletions

View File

@@ -198,10 +198,16 @@ autocmd InsertEnter * match ForbiddenWhitespace /\t\|\s\+\%#\@@<!$/
For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}: For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
@example @example
(setq c-default-style "k&r") (c-add-style "ffmpeg"
(setq-default c-basic-offset 4) '("k&r"
(setq-default indent-tabs-mode nil) (c-basic-offset . 4)
(setq-default show-trailing-whitespace t) (indent-tabs-mode nil)
(show-trailing-whitespace t)
(c-offsets-alist
(statement-cont . (c-lineup-assignments +)))
)
)
(setq c-default-style "ffmpeg")
@end example @end example
@section Development Policy @section Development Policy

View File

@@ -400,6 +400,7 @@ static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom)
entries = avio_rb32(pb); entries = avio_rb32(pb);
if (entries >= UINT_MAX / sizeof(*sc->drefs)) if (entries >= UINT_MAX / sizeof(*sc->drefs))
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
av_free(sc->drefs);
sc->drefs = av_mallocz(entries * sizeof(*sc->drefs)); sc->drefs = av_mallocz(entries * sizeof(*sc->drefs));
if (!sc->drefs) if (!sc->drefs)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
@@ -3039,6 +3040,7 @@ static const AVOption options[] = {
}; };
static const AVClass class = {"mov,mp4,m4a,3gp,3g2,mj2", av_default_item_name, options, LIBAVUTIL_VERSION_INT}; static const AVClass class = {"mov,mp4,m4a,3gp,3g2,mj2", av_default_item_name, options, LIBAVUTIL_VERSION_INT};
AVInputFormat ff_mov_demuxer = { AVInputFormat ff_mov_demuxer = {
.name = "mov,mp4,m4a,3gp,3g2,mj2", .name = "mov,mp4,m4a,3gp,3g2,mj2",
.long_name = NULL_IF_CONFIG_SMALL("QuickTime/MPEG-4/Motion JPEG 2000 format"), .long_name = NULL_IF_CONFIG_SMALL("QuickTime/MPEG-4/Motion JPEG 2000 format"),

View File

@@ -356,7 +356,7 @@ yuv2mono_2_c_template(SwsContext *c, const int16_t *buf[2],
{ {
const int16_t *buf0 = buf[0], *buf1 = buf[1]; const int16_t *buf0 = buf[0], *buf1 = buf[1];
const uint8_t * const d128 = dither_8x8_220[y & 7]; const uint8_t * const d128 = dither_8x8_220[y & 7];
int yalpha1 = 4095 - yalpha; int yalpha1 = 4096 - yalpha;
int i; int i;
for (i = 0; i < dstW; i += 8) { for (i = 0; i < dstW; i += 8) {
@@ -508,8 +508,8 @@ yuv2422_2_c_template(SwsContext *c, const int16_t *buf[2],
const int16_t *buf0 = buf[0], *buf1 = buf[1], const int16_t *buf0 = buf[0], *buf1 = buf[1],
*ubuf0 = ubuf[0], *ubuf1 = ubuf[1], *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
*vbuf0 = vbuf[0], *vbuf1 = vbuf[1]; *vbuf0 = vbuf[0], *vbuf1 = vbuf[1];
int yalpha1 = 4095 - yalpha; int yalpha1 = 4096 - yalpha;
int uvalpha1 = 4095 - uvalpha; int uvalpha1 = 4096 - uvalpha;
int i; int i;
for (i = 0; i < ((dstW + 1) >> 1); i++) { for (i = 0; i < ((dstW + 1) >> 1); i++) {
@@ -667,8 +667,8 @@ yuv2rgb48_2_c_template(SwsContext *c, const int32_t *buf[2],
const int32_t *buf0 = buf[0], *buf1 = buf[1], const int32_t *buf0 = buf[0], *buf1 = buf[1],
*ubuf0 = ubuf[0], *ubuf1 = ubuf[1], *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
*vbuf0 = vbuf[0], *vbuf1 = vbuf[1]; *vbuf0 = vbuf[0], *vbuf1 = vbuf[1];
int yalpha1 = 4095 - yalpha; int yalpha1 = 4096 - yalpha;
int uvalpha1 = 4095 - uvalpha; int uvalpha1 = 4096 - uvalpha;
int i; int i;
for (i = 0; i < ((dstW + 1) >> 1); i++) { for (i = 0; i < ((dstW + 1) >> 1); i++) {
@@ -1008,8 +1008,8 @@ yuv2rgb_2_c_template(SwsContext *c, const int16_t *buf[2],
*vbuf0 = vbuf[0], *vbuf1 = vbuf[1], *vbuf0 = vbuf[0], *vbuf1 = vbuf[1],
*abuf0 = hasAlpha ? abuf[0] : NULL, *abuf0 = hasAlpha ? abuf[0] : NULL,
*abuf1 = hasAlpha ? abuf[1] : NULL; *abuf1 = hasAlpha ? abuf[1] : NULL;
int yalpha1 = 4095 - yalpha; int yalpha1 = 4096 - yalpha;
int uvalpha1 = 4095 - uvalpha; int uvalpha1 = 4096 - uvalpha;
int i; int i;
for (i = 0; i < ((dstW + 1) >> 1); i++) { for (i = 0; i < ((dstW + 1) >> 1); i++) {