[FFmpeg-cvslog] avcodec/pngdec: create a function to decode IDAT chunk.
ffmpeg | branch: master | Benoit Fouet benoit.fo...@free.fr | Fri Nov 14 10:17:33 2014 +0100| [b35fa041521cf2b183e94697d57584c63c64dc3f] | committer: Michael Niedermayer avcodec/pngdec: create a function to decode IDAT chunk. Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b35fa041521cf2b183e94697d57584c63c64dc3f --- libavcodec/pngdec.c | 207 +++ 1 file changed, 109 insertions(+), 98 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 99a3a72..8199bd8 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -563,6 +563,114 @@ static int decode_phys_chunk(AVCodecContext *avctx, PNGDecContext *s) return 0; } +static int decode_idat_chunk(AVCodecContext *avctx, PNGDecContext *s, + uint32_t length, AVFrame *p) +{ +int ret; + +if (!(s-state PNG_IHDR)) { +av_log(avctx, AV_LOG_ERROR, IDAT without IHDR\n); +return AVERROR_INVALIDDATA; +} +if (!(s-state PNG_IDAT)) { +/* init image info */ +avctx-width = s-width; +avctx-height = s-height; + +s-channels = ff_png_get_nb_channels(s-color_type); +s-bits_per_pixel = s-bit_depth * s-channels; +s-bpp= (s-bits_per_pixel + 7) 3; +s-row_size = (avctx-width * s-bits_per_pixel + 7) 3; + +if ((s-bit_depth == 2 || s-bit_depth == 4 || s-bit_depth == 8) +s-color_type == PNG_COLOR_TYPE_RGB) { +avctx-pix_fmt = AV_PIX_FMT_RGB24; +} else if ((s-bit_depth == 2 || s-bit_depth == 4 || s-bit_depth == 8) +s-color_type == PNG_COLOR_TYPE_RGB_ALPHA) { +avctx-pix_fmt = AV_PIX_FMT_RGBA; +} else if ((s-bit_depth == 2 || s-bit_depth == 4 || s-bit_depth == 8) +s-color_type == PNG_COLOR_TYPE_GRAY) { +avctx-pix_fmt = AV_PIX_FMT_GRAY8; +} else if (s-bit_depth == 16 +s-color_type == PNG_COLOR_TYPE_GRAY) { +avctx-pix_fmt = AV_PIX_FMT_GRAY16BE; +} else if (s-bit_depth == 16 +s-color_type == PNG_COLOR_TYPE_RGB) { +avctx-pix_fmt = AV_PIX_FMT_RGB48BE; +} else if (s-bit_depth == 16 +s-color_type == PNG_COLOR_TYPE_RGB_ALPHA) { +avctx-pix_fmt = AV_PIX_FMT_RGBA64BE; +} else if ((s-bits_per_pixel == 1 || s-bits_per_pixel == 2 || s-bits_per_pixel == 4 || s-bits_per_pixel == 8) +s-color_type == PNG_COLOR_TYPE_PALETTE) { +avctx-pix_fmt = AV_PIX_FMT_PAL8; +} else if (s-bit_depth == 1 s-bits_per_pixel == 1) { +avctx-pix_fmt = AV_PIX_FMT_MONOBLACK; +} else if (s-bit_depth == 8 +s-color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { +avctx-pix_fmt = AV_PIX_FMT_YA8; +} else if (s-bit_depth == 16 +s-color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { +avctx-pix_fmt = AV_PIX_FMT_YA16BE; +} else { +av_log(avctx, AV_LOG_ERROR, unsupported bit depth %d +and color type %d\n, +s-bit_depth, s-color_type); +return AVERROR_INVALIDDATA; +} + +if ((ret = ff_thread_get_buffer(avctx, s-picture, AV_GET_BUFFER_FLAG_REF)) 0) +return ret; +ff_thread_finish_setup(avctx); + +p-pict_type= AV_PICTURE_TYPE_I; +p-key_frame= 1; +p-interlaced_frame = !!s-interlace_type; + +/* compute the compressed row size */ +if (!s-interlace_type) { +s-crow_size = s-row_size + 1; +} else { +s-pass = 0; +s-pass_row_size = ff_png_pass_row_size(s-pass, +s-bits_per_pixel, +s-width); +s-crow_size = s-pass_row_size + 1; +} +av_dlog(avctx, row_size=%d crow_size =%d\n, +s-row_size, s-crow_size); +s-image_buf = p-data[0]; +s-image_linesize = p-linesize[0]; +/* copy the palette if needed */ +if (avctx-pix_fmt == AV_PIX_FMT_PAL8) +memcpy(p-data[1], s-palette, 256 * sizeof(uint32_t)); +/* empty row is used if differencing to the first row */ +av_fast_padded_mallocz(s-last_row, s-last_row_size, s-row_size); +if (!s-last_row) +return AVERROR_INVALIDDATA; +if (s-interlace_type || +s-color_type == PNG_COLOR_TYPE_RGB_ALPHA) { +av_fast_padded_malloc(s-tmp_row, s-tmp_row_size, s-row_size); +if (!s-tmp_row) +return AVERROR_INVALIDDATA; +} +/* compressed row */ +av_fast_padded_malloc(s-buffer, s-buffer_size, s-row_size + 16); +if (!s-buffer) +return AVERROR(ENOMEM); + +/* we want crow_buf+1 to be 16-byte aligned */ +s-crow_buf = s-buffer +
[FFmpeg-cvslog] avcodec/pngdec: create a function to decode PLTE chunk.
ffmpeg | branch: master | Benoit Fouet benoit.fo...@free.fr | Fri Nov 14 10:17:34 2014 +0100| [4f313a50ee786fdcf01d094b3d0455906aaa4aa3] | committer: Michael Niedermayer avcodec/pngdec: create a function to decode PLTE chunk. Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4f313a50ee786fdcf01d094b3d0455906aaa4aa3 --- libavcodec/pngdec.c | 41 - 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 8199bd8..9b5d5dd 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -671,6 +671,29 @@ static int decode_idat_chunk(AVCodecContext *avctx, PNGDecContext *s, return 0; } +static int decode_plte_chunk(AVCodecContext *avctx, PNGDecContext *s, + uint32_t length) +{ +int n, i, r, g, b; + +if ((length % 3) != 0 || length 256 * 3) +return AVERROR_INVALIDDATA; +/* read the palette */ +n = length / 3; +for (i = 0; i n; i++) { +r = bytestream2_get_byte(s-gb); +g = bytestream2_get_byte(s-gb); +b = bytestream2_get_byte(s-gb); +s-palette[i] = (0xFFU 24) | (r 16) | (g 8) | b; +} +for (; i 256; i++) +s-palette[i] = (0xFFU 24); +s-state |= PNG_PLTE; +bytestream2_skip(s-gb, 4); /* crc */ + +return 0; +} + static int decode_frame_png(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) @@ -744,24 +767,8 @@ static int decode_frame_png(AVCodecContext *avctx, goto fail; break; case MKTAG('P', 'L', 'T', 'E'): -{ -int n, i, r, g, b; - -if ((length % 3) != 0 || length 256 * 3) +if (decode_plte_chunk(avctx, s, length) 0) goto skip_tag; -/* read the palette */ -n = length / 3; -for (i = 0; i n; i++) { -r = bytestream2_get_byte(s-gb); -g = bytestream2_get_byte(s-gb); -b = bytestream2_get_byte(s-gb); -s-palette[i] = (0xFFU 24) | (r 16) | (g 8) | b; -} -for (; i 256; i++) -s-palette[i] = (0xFFU 24); -s-state |= PNG_PLTE; -bytestream2_skip(s-gb, 4); /* crc */ -} break; case MKTAG('t', 'R', 'N', 'S'): { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/pngdec: fix some indentation/whitespaces
ffmpeg | branch: master | Benoit Fouet benoit.fo...@free.fr | Fri Nov 14 10:17:36 2014 +0100| [c25b6ae8a2b90c9cad1a89af705b66e65781f60c] | committer: Michael Niedermayer avcodec/pngdec: fix some indentation/whitespaces Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c25b6ae8a2b90c9cad1a89af705b66e65781f60c --- libavcodec/pngdec.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 92ed59d..776b0db 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -761,7 +761,7 @@ static int decode_frame_png(AVCodecContext *avctx, } length = bytestream2_get_be32(s-gb); -if (length 0x7fff || length bytestream2_get_bytes_left(s-gb)) { +if (length 0x7fff || length bytestream2_get_bytes_left(s-gb)) { av_log(avctx, AV_LOG_ERROR, chunk too big\n); goto fail; } @@ -788,11 +788,11 @@ static int decode_frame_png(AVCodecContext *avctx, case MKTAG('P', 'L', 'T', 'E'): if (decode_plte_chunk(avctx, s, length) 0) goto skip_tag; -break; +break; case MKTAG('t', 'R', 'N', 'S'): if (decode_trns_chunk(avctx, s, length) 0) goto skip_tag; -break; +break; case MKTAG('t', 'E', 'X', 't'): if (decode_text_chunk(s, length, 0, metadata) 0) av_log(avctx, AV_LOG_WARNING, Broken tEXt chunk\n); @@ -820,7 +820,7 @@ skip_tag: } exit_loop: -if (s-bits_per_pixel == 1 s-color_type == PNG_COLOR_TYPE_PALETTE){ +if (s-bits_per_pixel == 1 s-color_type == PNG_COLOR_TYPE_PALETTE) { int i, j, k; uint8_t *pd = p-data[0]; for (j = 0; j s-height; j++) { @@ -846,7 +846,7 @@ exit_loop: uint8_t *pd = p-data[0]; for (j = 0; j s-height; j++) { i = s-width / 4; -if (s-color_type == PNG_COLOR_TYPE_PALETTE){ +if (s-color_type == PNG_COLOR_TYPE_PALETTE) { if ((s-width3) = 3) pd[4*i + 2]= (pd[i] 2) 3; if ((s-width3) = 2) pd[4*i + 1]= (pd[i] 4) 3; if ((s-width3) = 1) pd[4*i + 0]= pd[i] 6; @@ -875,12 +875,12 @@ exit_loop: uint8_t *pd = p-data[0]; for (j = 0; j s-height; j++) { i = s-width/2; -if (s-color_type == PNG_COLOR_TYPE_PALETTE){ +if (s-color_type == PNG_COLOR_TYPE_PALETTE) { if (s-width1) pd[2*i+0]= pd[i]4; for (i--; i = 0; i--) { -pd[2*i + 1] = pd[i] 15; -pd[2*i + 0] = pd[i] 4; -} +pd[2*i + 1] = pd[i] 15; +pd[2*i + 0] = pd[i] 4; +} } else { if (s-width 1) pd[2*i + 0]= (pd[i] 4) * 0x11; for (i--; i = 0; i--) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/pngdec: create a function to decode tRNS chunk.
ffmpeg | branch: master | Benoit Fouet benoit.fo...@free.fr | Fri Nov 14 10:17:35 2014 +0100| [6499e63f7b9e73d5b6b601f25803f9244de99bf6] | committer: Michael Niedermayer avcodec/pngdec: create a function to decode tRNS chunk. Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6499e63f7b9e73d5b6b601f25803f9244de99bf6 --- libavcodec/pngdec.c | 33 - 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 9b5d5dd..92ed59d 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -694,6 +694,25 @@ static int decode_plte_chunk(AVCodecContext *avctx, PNGDecContext *s, return 0; } +static int decode_trns_chunk(AVCodecContext *avctx, PNGDecContext *s, + uint32_t length) +{ +int v, i; + +/* read the transparency. XXX: Only palette mode supported */ +if (s-color_type != PNG_COLOR_TYPE_PALETTE || +length 256 || +!(s-state PNG_PLTE)) +return AVERROR_INVALIDDATA; +for (i = 0; i length; i++) { +v = bytestream2_get_byte(s-gb); +s-palette[i] = (s-palette[i] 0x00ff) | (v 24); +} +bytestream2_skip(s-gb, 4); /* crc */ + +return 0; +} + static int decode_frame_png(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) @@ -771,20 +790,8 @@ static int decode_frame_png(AVCodecContext *avctx, goto skip_tag; break; case MKTAG('t', 'R', 'N', 'S'): -{ -int v, i; - -/* read the transparency. XXX: Only palette mode supported */ -if (s-color_type != PNG_COLOR_TYPE_PALETTE || -length 256 || -!(s-state PNG_PLTE)) +if (decode_trns_chunk(avctx, s, length) 0) goto skip_tag; -for (i = 0; i length; i++) { -v = bytestream2_get_byte(s-gb); -s-palette[i] = (s-palette[i] 0x00ff) | (v 24); -} -bytestream2_skip(s-gb, 4); /* crc */ -} break; case MKTAG('t', 'E', 'X', 't'): if (decode_text_chunk(s, length, 0, metadata) 0) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/pngdec: use else if instead of if for small bpp handling.
ffmpeg | branch: master | Benoit Fouet benoit.fo...@free.fr | Fri Nov 14 10:17:37 2014 +0100| [24ca2ffad826cb660aa53a25cc35b2a2702ace0e] | committer: Michael Niedermayer avcodec/pngdec: use else if instead of if for small bpp handling. Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=24ca2ffad826cb660aa53a25cc35b2a2702ace0e --- libavcodec/pngdec.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 776b0db..2f22ade 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -840,8 +840,7 @@ exit_loop: } pd += s-image_linesize; } -} -if (s-bits_per_pixel == 2){ +} else if (s-bits_per_pixel == 2) { int i, j; uint8_t *pd = p-data[0]; for (j = 0; j s-height; j++) { @@ -869,8 +868,7 @@ exit_loop: } pd += s-image_linesize; } -} -if (s-bits_per_pixel == 4){ +} else if (s-bits_per_pixel == 4) { int i, j; uint8_t *pd = p-data[0]; for (j = 0; j s-height; j++) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/pngdec: create a function to handle small (=4) bits per pixel values.
ffmpeg | branch: master | Benoit Fouet benoit.fo...@free.fr | Fri Nov 14 10:17:38 2014 +0100| [8cab24df0780ccd8acf5f9e9554b2be9459e8be2] | committer: Michael Niedermayer avcodec/pngdec: create a function to handle small (=4) bits per pixel values. Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8cab24df0780ccd8acf5f9e9554b2be9459e8be2 --- libavcodec/pngdec.c | 144 +++ 1 file changed, 75 insertions(+), 69 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 2f22ade..d3c8ef9 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -713,6 +713,79 @@ static int decode_trns_chunk(AVCodecContext *avctx, PNGDecContext *s, return 0; } +static void handle_small_bpp(PNGDecContext *s, AVFrame *p) +{ +if (s-bits_per_pixel == 1 s-color_type == PNG_COLOR_TYPE_PALETTE) { +int i, j, k; +uint8_t *pd = p-data[0]; +for (j = 0; j s-height; j++) { +i = s-width / 8; +for (k = 7; k = 1; k--) +if ((s-width7) = k) +pd[8*i + k - 1] = (pd[i]8-k) 1; +for (i--; i = 0; i--) { +pd[8*i + 7]= pd[i] 1; +pd[8*i + 6]= (pd[i]1) 1; +pd[8*i + 5]= (pd[i]2) 1; +pd[8*i + 4]= (pd[i]3) 1; +pd[8*i + 3]= (pd[i]4) 1; +pd[8*i + 2]= (pd[i]5) 1; +pd[8*i + 1]= (pd[i]6) 1; +pd[8*i + 0]= pd[i]7; +} +pd += s-image_linesize; +} +} else if (s-bits_per_pixel == 2) { +int i, j; +uint8_t *pd = p-data[0]; +for (j = 0; j s-height; j++) { +i = s-width / 4; +if (s-color_type == PNG_COLOR_TYPE_PALETTE) { +if ((s-width3) = 3) pd[4*i + 2]= (pd[i] 2) 3; +if ((s-width3) = 2) pd[4*i + 1]= (pd[i] 4) 3; +if ((s-width3) = 1) pd[4*i + 0]= pd[i] 6; +for (i--; i = 0; i--) { +pd[4*i + 3]= pd[i] 3; +pd[4*i + 2]= (pd[i]2) 3; +pd[4*i + 1]= (pd[i]4) 3; +pd[4*i + 0]= pd[i]6; +} +} else { +if ((s-width3) = 3) pd[4*i + 2]= ((pd[i]2) 3)*0x55; +if ((s-width3) = 2) pd[4*i + 1]= ((pd[i]4) 3)*0x55; +if ((s-width3) = 1) pd[4*i + 0]= ( pd[i]6 )*0x55; +for (i--; i = 0; i--) { +pd[4*i + 3]= ( pd[i] 3)*0x55; +pd[4*i + 2]= ((pd[i]2) 3)*0x55; +pd[4*i + 1]= ((pd[i]4) 3)*0x55; +pd[4*i + 0]= ( pd[i]6 )*0x55; +} +} +pd += s-image_linesize; +} +} else if (s-bits_per_pixel == 4) { +int i, j; +uint8_t *pd = p-data[0]; +for (j = 0; j s-height; j++) { +i = s-width/2; +if (s-color_type == PNG_COLOR_TYPE_PALETTE) { +if (s-width1) pd[2*i+0]= pd[i]4; +for (i--; i = 0; i--) { +pd[2*i + 1] = pd[i] 15; +pd[2*i + 0] = pd[i] 4; +} +} else { +if (s-width 1) pd[2*i + 0]= (pd[i] 4) * 0x11; +for (i--; i = 0; i--) { +pd[2*i + 1] = (pd[i] 15) * 0x11; +pd[2*i + 0] = (pd[i] 4) * 0x11; +} +} +pd += s-image_linesize; +} +} +} + static int decode_frame_png(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) @@ -820,75 +893,8 @@ skip_tag: } exit_loop: -if (s-bits_per_pixel == 1 s-color_type == PNG_COLOR_TYPE_PALETTE) { -int i, j, k; -uint8_t *pd = p-data[0]; -for (j = 0; j s-height; j++) { -i = s-width / 8; -for (k = 7; k = 1; k--) -if ((s-width7) = k) -pd[8*i + k - 1] = (pd[i]8-k) 1; -for (i--; i = 0; i--) { -pd[8*i + 7]= pd[i] 1; -pd[8*i + 6]= (pd[i]1) 1; -pd[8*i + 5]= (pd[i]2) 1; -pd[8*i + 4]= (pd[i]3) 1; -pd[8*i + 3]= (pd[i]4) 1; -pd[8*i + 2]= (pd[i]5) 1; -pd[8*i + 1]= (pd[i]6) 1; -pd[8*i + 0]= pd[i]7; -} -pd += s-image_linesize; -} -} else if (s-bits_per_pixel == 2) { -int i, j; -uint8_t *pd = p-data[0]; -for (j = 0; j s-height; j++) { -i = s-width / 4; -if (s-color_type == PNG_COLOR_TYPE_PALETTE) { -if ((s-width3) = 3) pd[4*i + 2]= (pd[i] 2) 3; -if ((s-width3) = 2) pd[4*i + 1]= (pd[i] 4) 3; -if ((s-width3) = 1) pd[4*i + 0]= pd[i]
[FFmpeg-cvslog] tests/Makefile: Fix path for creation of ffprobe-test.nut.
ffmpeg | branch: master | Carl Eugen Hoyos ceho...@ag.or.at | Fri Nov 14 17:30:16 2014 +0100| [cde0ad5ea780b1fef1890b3f55d8e6e3e1bdf96f] | committer: Carl Eugen Hoyos tests/Makefile: Fix path for creation of ffprobe-test.nut. http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cde0ad5ea780b1fef1890b3f55d8e6e3e1bdf96f --- tests/Makefile |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Makefile b/tests/Makefile index 19800dd..7ef8132 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -47,7 +47,7 @@ tests/data/ffprobe-test.nut: ffmpeg$(EXESUF) tests/test_copy.ffmeta -flags +bitexact -map 0:0 -map 0:1 -map 0:2 -map_metadata 1 \ -map_metadata:s:0 1:s:0 -map_metadata:s:1 1:s:1 \ -vcodec rawvideo -acodec pcm_s16le \ --y $@ 2/dev/null +-y $(TARGET_PATH)/$@ 2/dev/null tests/data/%.sw tests/data/asynth% tests/data/vsynth%.yuv tests/vsynth%/00.pgm tests/data/%.nut: TAG = GEN ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavd/avfoundation: Introduce device alias 'none' to allow the user to record only audio or video.
ffmpeg | branch: master | Thilo Borgmann thilo.borgm...@mail.de | Thu Nov 13 17:22:48 2014 +0100| [2045334239459f49e513a42e1b9965a94c5a0f5f] | committer: Michael Niedermayer lavd/avfoundation: Introduce device alias 'none' to allow the user to record only audio or video. Changes the selection of a default device to none instead of the system default device. Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2045334239459f49e513a42e1b9965a94c5a0f5f --- libavdevice/avfoundation.m | 16 ++-- libavdevice/version.h |2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m index 1207cbf..1a7eb5b 100644 --- a/libavdevice/avfoundation.m +++ b/libavdevice/avfoundation.m @@ -604,7 +604,10 @@ static int avf_read_header(AVFormatContext *s) goto fail; } } else if (ctx-video_filename - strncmp(ctx-video_filename, default, 7)) { + strncmp(ctx-video_filename, none, 4)) { +if (!strncmp(ctx-video_filename, default, 7)) { +video_device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; +} else { // looking for video inputs for (AVCaptureDevice *device in video_devices) { if (!strncmp(ctx-video_filename, [[device localizedName] UTF8String], strlen(ctx-video_filename))) { @@ -626,13 +629,12 @@ static int avf_read_header(AVFormatContext *s) } } #endif +} if (!video_device) { av_log(ctx, AV_LOG_ERROR, Video device not found\n); goto fail; } -} else { -video_device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; } // get audio device @@ -646,7 +648,10 @@ static int avf_read_header(AVFormatContext *s) audio_device = [devices objectAtIndex:ctx-audio_device_index]; } else if (ctx-audio_filename - strncmp(ctx-audio_filename, default, 7)) { + strncmp(ctx-audio_filename, none, 4)) { +if (!strncmp(ctx-audio_filename, default, 7)) { +audio_device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio]; +} else { NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeAudio]; for (AVCaptureDevice *device in devices) { @@ -655,13 +660,12 @@ static int avf_read_header(AVFormatContext *s) break; } } +} if (!audio_device) { av_log(ctx, AV_LOG_ERROR, Audio device not found\n); goto fail; } -} else { -audio_device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio]; } // Video nor Audio capture device not found, looking for AVMediaTypeVideo/Audio diff --git a/libavdevice/version.h b/libavdevice/version.h index 630f654..3e427f0 100644 --- a/libavdevice/version.h +++ b/libavdevice/version.h @@ -28,7 +28,7 @@ #include libavutil/version.h #define LIBAVDEVICE_VERSION_MAJOR 56 -#define LIBAVDEVICE_VERSION_MINOR 2 +#define LIBAVDEVICE_VERSION_MINOR 3 #define LIBAVDEVICE_VERSION_MICRO 100 #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Changelog: Mention AVFoundation screen capturing.
ffmpeg | branch: master | Thilo Borgmann thilo.borgm...@mail.de | Thu Nov 13 17:24:14 2014 +0100| [d525e662e4f923c229cf5acfedf37a29bf617fe1] | committer: Michael Niedermayer Changelog: Mention AVFoundation screen capturing. Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d525e662e4f923c229cf5acfedf37a29bf617fe1 --- Changelog |1 + 1 file changed, 1 insertion(+) diff --git a/Changelog b/Changelog index 30a1dd2..c25fafd 100644 --- a/Changelog +++ b/Changelog @@ -11,6 +11,7 @@ version next: - XCB-based screen-grabber - UDP-Lite support (RFC 3828) - xBR scaling filter +- AVFoundation screen capturing support version 2.4: - Icecast protocol ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] proresenc_kostya: report buffer overflow
ffmpeg | branch: release/2.0 | Christophe Gisquet christophe.gisq...@gmail.com | Mon Aug 11 22:06:08 2014 +| [57a6cd8ab1c221cad1c2c49ff02216d752684651] | committer: Michael Niedermayer proresenc_kostya: report buffer overflow If the allocated size, despite best efforts, is too small, exit with the appropriate error. Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 52b81ff4635c077b2bc8b8d3637d933b6629d803) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=57a6cd8ab1c221cad1c2c49ff02216d752684651 --- libavcodec/proresenc_kostya.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index d80280b..a22efa4 100644 --- a/libavcodec/proresenc_kostya.c +++ b/libavcodec/proresenc_kostya.c @@ -569,6 +569,11 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic, quant); } total_size += sizes[i]; +if (put_bits_left(pb) 0) { +av_log(avctx, AV_LOG_ERROR, Serious underevaluation of + required buffer size); +return AVERROR_BUFFER_TOO_SMALL; +} } return total_size; } @@ -939,9 +944,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, avctx-coded_frame-pict_type = AV_PICTURE_TYPE_I; avctx-coded_frame-key_frame = 1; -pkt_size = ctx-frame_size_upper_bound + FF_MIN_BUFFER_SIZE; +pkt_size = ctx-frame_size_upper_bound; -if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size)) 0) +if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size + FF_MIN_BUFFER_SIZE)) 0) return ret; orig_buf = pkt-data; @@ -1018,7 +1023,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, slice_hdr = buf; buf += slice_hdr_size - 1; init_put_bits(pb, buf, (pkt_size - (buf - orig_buf)) * 8); -encode_slice(avctx, pic, pb, sizes, x, y, q, mbs_per_slice); +ret = encode_slice(avctx, pic, pb, sizes, x, y, q, mbs_per_slice); +if (ret 0) +return ret; bytestream_put_byte(slice_hdr, q); slice_size = slice_hdr_size + sizes[ctx-num_planes - 1]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/swfdec: Use side data to communicate w/h changes to the decoder
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Tue Sep 2 05:22:26 2014 +0200| [d7d29f0d433ad6c12c7cecd2a537aaef53d51808] | committer: Michael Niedermayer avformat/swfdec: Use side data to communicate w/h changes to the decoder Fixes reading from freed data Fixes part of Ticket3539 Reviewed-by: Paul B Mahol one...@gmail.com Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 1c55d0ff3202a04ebc67a72d72391104e9bdb633) Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit a9734e7d3017ffc9539eaac2a8acce3ad427f746) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d7d29f0d433ad6c12c7cecd2a537aaef53d51808 --- libavformat/swfdec.c |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c index 54e0f6d..00926c8 100644 --- a/libavformat/swfdec.c +++ b/libavformat/swfdec.c @@ -347,11 +347,15 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) avpriv_set_pts_info(vst, 64, 256, swf-frame_rate); st = vst; } -st-codec-width = width; -st-codec-height = height; if ((res = av_new_packet(pkt, out_len - colormapsize * colormapbpp)) 0) goto bitmap_end; +if (!st-codec-width !st-codec-height) { +st-codec-width = width; +st-codec-height = height; +} else { +ff_add_param_change(pkt, 0, 0, 0, width, height); +} pkt-pos = pos; pkt-stream_index = st-index; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/utils: do not wait for packets from discarded streams for genpts
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Sun Jul 13 01:07:59 2014 +0200| [dd72df9845d0687d03be6a5b830c8ed84edaa907] | committer: Michael Niedermayer avformat/utils: do not wait for packets from discarded streams for genpts Fixes long loop Fixes Ticket3208 Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 8202c49b43621c04e26d4a3aa83a10e1e5cc1836) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dd72df9845d0687d03be6a5b830c8ed84edaa907 --- libavformat/utils.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index a010f29..3280a0d 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1440,7 +1440,8 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt) } /* read packet from packet buffer, if there is data */ -if (!(next_pkt-pts == AV_NOPTS_VALUE +st = s-streams[next_pkt-stream_index]; +if (!(next_pkt-pts == AV_NOPTS_VALUE st-discard AVDISCARD_ALL next_pkt-dts != AV_NOPTS_VALUE !eof)) { ret = read_from_packet_buffer(s-packet_buffer, s-packet_buffer_end, pkt); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] wavpack: report if there is no bits left
ffmpeg | branch: release/2.0 | Christophe Gisquet christophe.gisq...@gmail.com | Tue Aug 19 12:26:47 2014 +| [2958b8b86e3674b2be87abba92135b9a928e06f1] | committer: Michael Niedermayer wavpack: report if there is no bits left Reviewed-by: Paul B Mahol one...@gmail.com Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 11a39bdf534a4ead634b4a593c66ebf756910b9b) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2958b8b86e3674b2be87abba92135b9a928e06f1 --- libavcodec/wavpack.c |4 1 file changed, 4 insertions(+) diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 47f598a..82c9b37 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -411,6 +411,10 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb, return sign ? ~ret : ret; error: +ret = get_bits_left(gb); +if (ret = 0) { +av_log(ctx-avctx, AV_LOG_ERROR, Too few bits (%d) left\n, ret); +} *last = 1; return 0; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/utils: add GBRP16 to avcodec_align_dimensions2()
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Sun Aug 24 23:33:40 2014 +0200| [d4253b3a5b7431053810844323a5cb4ea0293810] | committer: Michael Niedermayer avcodec/utils: add GBRP16 to avcodec_align_dimensions2() Fixes Ticket3869 Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 3fe9e7be4c70c8fccdcd56fd19276e668cfb7de8) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d4253b3a5b7431053810844323a5cb4ea0293810 --- libavcodec/utils.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index f3dc853..7f6792d 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -260,6 +260,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, case AV_PIX_FMT_GBRP12BE: case AV_PIX_FMT_GBRP14LE: case AV_PIX_FMT_GBRP14BE: +case AV_PIX_FMT_GBRP16LE: +case AV_PIX_FMT_GBRP16BE: w_align = 16; //FIXME assume 16 pixel per macroblock h_align = 16 * 2; // interlaced needs 2 macroblocks height break; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/tee: flip assigment direction
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Sat Aug 2 22:30:03 2014 +0200| [04973b02c3aa6a0c3a2f013b6266ff68623fc425] | committer: Michael Niedermayer avformat/tee: flip assigment direction Found-by: CSA Reviewed-by: Nicolas George geo...@nsup.org Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 2e6fdcb7f3c86491408a3699f0aa9dc52b7c5686) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=04973b02c3aa6a0c3a2f013b6266ff68623fc425 --- libavformat/tee.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/tee.c b/libavformat/tee.c index 7b8b371..d1dab90 100644 --- a/libavformat/tee.c +++ b/libavformat/tee.c @@ -251,7 +251,7 @@ static int tee_write_packet(AVFormatContext *avf, AVPacket *pkt) if ((ret = av_copy_packet(pkt2, pkt)) 0 || (ret = av_dup_packet(pkt2)) 0) if (!ret_all) { -ret = ret_all; +ret_all = ret; continue; } tb = avf -streams[s]-time_base; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffmpeg: Use av_stream_get_parser() to avoid ABI issues
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Mon Jul 14 21:06:58 2014 +0200| [2428b02bb4beeb16873a85f492bb83969de30976] | committer: Michael Niedermayer ffmpeg: Use av_stream_get_parser() to avoid ABI issues Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 8bbadc9b6ec71abbd9dab854c47027b949997af0) Conflicts: ffmpeg.c (cherry picked from commit 8fae6207e30059611cdc788ad440b6831637f86f) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2428b02bb4beeb16873a85f492bb83969de30976 --- ffmpeg.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 2a9bafd..2f18bc1 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -1452,7 +1452,7 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p ost-st-codec-codec_id != AV_CODEC_ID_MPEG2VIDEO ost-st-codec-codec_id != AV_CODEC_ID_VC1 ) { -if (av_parser_change(ist-st-parser, ost-st-codec, opkt.data, opkt.size, pkt-data, pkt-size, pkt-flags AV_PKT_FLAG_KEY)) { +if (av_parser_change(av_stream_get_parser(ist-st), ost-st-codec, opkt.data, opkt.size, pkt-data, pkt-size, pkt-flags AV_PKT_FLAG_KEY)) { opkt.buf = av_buffer_create(opkt.data, opkt.size, av_buffer_default_free, NULL, 0); if (!opkt.buf) exit_program(1); @@ -1852,7 +1852,7 @@ static int output_packet(InputStream *ist, const AVPacket *pkt) if (avpkt.duration) { duration = av_rescale_q(avpkt.duration, ist-st-time_base, AV_TIME_BASE_Q); } else if(ist-st-codec-time_base.num != 0 ist-st-codec-time_base.den != 0) { -int ticks= ist-st-parser ? ist-st-parser-repeat_pict+1 : ist-st-codec-ticks_per_frame; +int ticks= av_stream_get_parser(ist-st) ? av_stream_get_parser(ist-st)-repeat_pict+1 : ist-st-codec-ticks_per_frame; duration = ((int64_t)AV_TIME_BASE * ist-st-codec-time_base.num * ticks) / ist-st-codec-time_base.den; @@ -1909,7 +1909,7 @@ static int output_packet(InputStream *ist, const AVPacket *pkt) } else if (pkt-duration) { ist-next_dts += av_rescale_q(pkt-duration, ist-st-time_base, AV_TIME_BASE_Q); } else if(ist-st-codec-time_base.num != 0) { -int ticks= ist-st-parser ? ist-st-parser-repeat_pict + 1 : ist-st-codec-ticks_per_frame; +int ticks= av_stream_get_parser(ist-st) ? av_stream_get_parser(ist-st)-repeat_pict + 1 : ist-st-codec-ticks_per_frame; ist-next_dts += ((int64_t)AV_TIME_BASE * ist-st-codec-time_base.num * ticks) / ist-st-codec-time_base.den; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/iff: check pixfmt for rgb8 / rgbn
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Sun Aug 10 21:59:33 2014 +0200| [656f930160db48e0b7b25069c62abc340e7f0628] | committer: Michael Niedermayer avcodec/iff: check pixfmt for rgb8 / rgbn Fixes out of array access Found-by: Piotr Bandurski ami_st...@o2.pl Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 3539d6c63a16e1b2874bb037a86f317449c58770) Conflicts: libavcodec/iff.c http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=656f930160db48e0b7b25069c62abc340e7f0628 --- libavcodec/iff.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/iff.c b/libavcodec/iff.c index 716a731..b41ee65 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -829,9 +829,9 @@ static int decode_frame(AVCodecContext *avctx, break; case 4: bytestream2_init(gb, buf, buf_size); -if (avctx-codec_tag == MKTAG('R','G','B','8')) +if (avctx-codec_tag == MKTAG('R','G','B','8') avctx-pix_fmt == AV_PIX_FMT_RGB32) decode_rgb8(gb, s-frame-data[0], avctx-width, avctx-height, s-frame-linesize[0]); -else if (avctx-codec_tag == MKTAG('R','G','B','N')) +else if (avctx-codec_tag == MKTAG('R','G','B','N') avctx-pix_fmt == AV_PIX_FMT_RGB444) decode_rgbn(gb, s-frame-data[0], avctx-width, avctx-height, s-frame-linesize[0]); else return unsupported(avctx); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffmpeg_opt: Use av_guess_codec() instead of AVOutputFormat-*codec
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Sat Aug 2 03:29:42 2014 +0200| [bcb10b99f4e86692b02e3ce38a89e21874b77dc9] | committer: Michael Niedermayer ffmpeg_opt: Use av_guess_codec() instead of AVOutputFormat-*codec Fixes part of ticket2236 Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 956f4087c6eb717e31f3b92fe03fd56a3747eccf) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bcb10b99f4e86692b02e3ce38a89e21874b77dc9 --- ffmpeg_opt.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index 286f973..8b2b83e 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -1681,7 +1681,7 @@ static int open_output_file(OptionsContext *o, const char *filename) /* pick the best stream of each type */ /* video: highest resolution */ -if (!o-video_disable oc-oformat-video_codec != AV_CODEC_ID_NONE) { +if (!o-video_disable av_guess_codec(oc-oformat, NULL, filename, NULL, AVMEDIA_TYPE_VIDEO) != AV_CODEC_ID_NONE) { int area = 0, idx = -1; int qcr = avformat_query_codec(oc-oformat, oc-oformat-video_codec, 0); for (i = 0; i nb_input_streams; i++) { @@ -1703,7 +1703,7 @@ static int open_output_file(OptionsContext *o, const char *filename) } /* audio: most channels */ -if (!o-audio_disable oc-oformat-audio_codec != AV_CODEC_ID_NONE) { +if (!o-audio_disable av_guess_codec(oc-oformat, NULL, filename, NULL, AVMEDIA_TYPE_AUDIO) != AV_CODEC_ID_NONE) { int channels = 0, idx = -1; for (i = 0; i nb_input_streams; i++) { ist = input_streams[i]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat: add av_stream_get_parser() to access avformat AVParser
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Mon Jul 14 21:03:43 2014 +0200| [c2af6b500bcf5bf59380c404b77edeb0c6eb46a2] | committer: Michael Niedermayer avformat: add av_stream_get_parser() to access avformat AVParser The AVStream.parser field is considered private and its location cannot be preserved while preserving also ABI compatibility to libav, as libav added fields before it. Some tools like ffmpeg.c access this field though Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 62227a70f0a4c07d7ead5775d8bad64797f8ef80) Conflicts: RELEASE_NOTES doc/APIchanges libavformat/utils.c libavformat/version.h (cherry picked from commit a78e6363e9a7ef90bd1ff4aeceee8e5501cbc6d4) Conflicts: libavformat/utils.c http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c2af6b500bcf5bf59380c404b77edeb0c6eb46a2 --- libavformat/avformat.h |1 + libavformat/utils.c|5 + 2 files changed, 6 insertions(+) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 04fad94..2adcae2 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -892,6 +892,7 @@ typedef struct AVStream { AVRational av_stream_get_r_frame_rate(const AVStream *s); void av_stream_set_r_frame_rate(AVStream *s, AVRational r); +struct AVCodecParserContext *av_stream_get_parser(const AVStream *s); #define AV_PROGRAM_RUNNING 1 diff --git a/libavformat/utils.c b/libavformat/utils.c index 3280a0d..4cb0adf 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -103,6 +103,11 @@ static int64_t wrap_timestamp(AVStream *st, int64_t timestamp) MAKE_ACCESSORS(AVStream, stream, AVRational, r_frame_rate) +struct AVCodecParserContext *av_stream_get_parser(const AVStream *st) +{ +return st-parser; +} + /* an arbitrarily chosen sane max packet size -- 50M */ #define SANE_CHUNK_SIZE (5000) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dvdsub_parser: print message if packet is smaller than the packet size field
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Sat Aug 2 01:16:14 2014 +0200| [65f581472c48bd9093c1df7f045db72df7006c3b] | committer: Michael Niedermayer avcodec/dvdsub_parser: print message if packet is smaller than the packet size field Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit bcc898dd2643c883522ffa565be4b226ce798c78) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=65f581472c48bd9093c1df7f045db72df7006c3b --- libavcodec/dvdsub_parser.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/dvdsub_parser.c b/libavcodec/dvdsub_parser.c index 07ed4f7..32a945e 100644 --- a/libavcodec/dvdsub_parser.c +++ b/libavcodec/dvdsub_parser.c @@ -46,6 +46,8 @@ static int dvdsub_parse(AVCodecParserContext *s, if (pc-packet_index == 0) { if (buf_size 2 || AV_RB16(buf) buf_size 6) { +if (buf_size) +av_log(avctx, AV_LOG_DEBUG, Parser input %d too small\n, buf_size); return buf_size; } pc-packet_len = AV_RB16(buf); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/swfdec: Do not change the pixel format
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Tue Sep 2 16:42:33 2014 +0200| [2fdb02693bbd6d534d91af9aa5d004cf5f056801] | committer: Michael Niedermayer avformat/swfdec: Do not change the pixel format This is currently not supported Fixes part of Ticket 3539 Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit c2430304dfb3cc0e3a59ce6d1b59ebdcc934a0c2) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2fdb02693bbd6d534d91af9aa5d004cf5f056801 --- libavformat/swfdec.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c index 00926c8..bf5b581 100644 --- a/libavformat/swfdec.c +++ b/libavformat/swfdec.c @@ -283,6 +283,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) const int bmp_fmt = avio_r8(pb); const int width = avio_rl16(pb); const int height = avio_rl16(pb); +int pix_fmt; len -= 2+1+2+2; @@ -361,7 +362,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) switch (bmp_fmt) { case 3: -st-codec-pix_fmt = AV_PIX_FMT_PAL8; +pix_fmt = AV_PIX_FMT_PAL8; for (i = 0; i colormapsize; i++) if (alpha_bmp) colormap[i] = buf[3]24 | AV_RB24(buf + 4*i); elsecolormap[i] = 0xffU 24 | AV_RB24(buf + 3*i); @@ -373,14 +374,20 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) memcpy(pal, colormap, AVPALETTE_SIZE); break; case 4: -st-codec-pix_fmt = AV_PIX_FMT_RGB555; +pix_fmt = AV_PIX_FMT_RGB555; break; case 5: -st-codec-pix_fmt = alpha_bmp ? AV_PIX_FMT_ARGB : AV_PIX_FMT_0RGB; +pix_fmt = alpha_bmp ? AV_PIX_FMT_ARGB : AV_PIX_FMT_0RGB; break; default: av_assert0(0); } +if (st-codec-pix_fmt != AV_PIX_FMT_NONE st-codec-pix_fmt != pix_fmt) { +av_log(s, AV_LOG_ERROR, pixel format change unsupported\n); +res = AVERROR_PATCHWELCOME; +goto bitmap_end; +} +st-codec-pix_fmt = pix_fmt; if (linesize * height pkt-size) { res = AVERROR_INVALIDDATA; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] x86/dsputil: add emms to ff_scalarproduct_int16_mmxext()
ffmpeg | branch: release/2.0 | James Almer jamr...@gmail.com | Wed Mar 5 19:44:36 2014 -0300| [992ce9777c7e3f4268f66db9b7c5b1375e65d484] | committer: Michael Niedermayer x86/dsputil: add emms to ff_scalarproduct_int16_mmxext() Also undo the changes to ra144enc.c from previous commits. Should fix ticket #3429 Signed-off-by: James Almer jamr...@gmail.com Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 9e0e1f9067430de1655a7b28536b5afed48bded5) Conflicts: libavcodec/ra144enc.c Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=992ce9777c7e3f4268f66db9b7c5b1375e65d484 --- libavcodec/ra144enc.c |1 - libavcodec/x86/dsputil.asm |3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/ra144enc.c b/libavcodec/ra144enc.c index da55b73..61cd95f 100644 --- a/libavcodec/ra144enc.c +++ b/libavcodec/ra144enc.c @@ -34,7 +34,6 @@ #include celp_filters.h #include ra144.h - static av_cold int ra144_encode_close(AVCodecContext *avctx) { RA144Context *ractx = avctx-priv_data; diff --git a/libavcodec/x86/dsputil.asm b/libavcodec/x86/dsputil.asm index 77069e2..d7825ee 100644 --- a/libavcodec/x86/dsputil.asm +++ b/libavcodec/x86/dsputil.asm @@ -61,6 +61,9 @@ cglobal scalarproduct_int16, 3,3,3, v1, v2, order %endif paddd m2, m0 movd eax, m2 +%if mmsize == 8 +emms +%endif RET ; int scalarproduct_and_madd_int16(int16_t *v1, int16_t *v2, int16_t *v3, int order, int mul) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] proresenc_kostya: properly account for alpha
ffmpeg | branch: release/2.0 | Christophe Gisquet christophe.gisq...@gmail.com | Mon Aug 11 19:43:27 2014 +0200| [caf08defa69f13aef60bdbcee5b4cf4092d0aaa4] | committer: Michael Niedermayer proresenc_kostya: properly account for alpha The packet buffer allocation considered as dct-coded, while it is actually run-coded and thus requires a larger buffer. Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 117bc8e6ffc744fedcf77edf2fdb33c964b83370) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=caf08defa69f13aef60bdbcee5b4cf4092d0aaa4 --- libavcodec/proresenc_kostya.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index a22efa4..ab43430 100644 --- a/libavcodec/proresenc_kostya.c +++ b/libavcodec/proresenc_kostya.c @@ -1193,8 +1193,6 @@ static av_cold int encode_init(AVCodecContext *avctx) ctx-bits_per_mb = ls * 8; if (ctx-chroma_factor == CFACTOR_Y444) ctx-bits_per_mb += ls * 4; -if (ctx-num_planes == 4) -ctx-bits_per_mb += ls * 4; } ctx-frame_size_upper_bound = ctx-pictures_per_frame * @@ -1203,6 +1201,14 @@ static av_cold int encode_init(AVCodecContext *avctx) (mps * ctx-bits_per_mb) / 8) + 200; +if (ctx-alpha_bits) { + // alpha plane is run-coded and might run over bit budget + ctx-frame_size_upper_bound += ctx-pictures_per_frame * +ctx-slices_per_picture * + /* num pixels per slice */ (ctx-mbs_per_slice * 256 * + /* bits per pixel */(1 + ctx-alpha_bits + 1) + 7 3); +} + avctx-codec_tag = ctx-profile_info-tag; av_log(avctx, AV_LOG_DEBUG, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dvdsub_parser: never return 0 when the input isnt 0
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Sat Aug 2 00:27:23 2014 +0200| [8d48223a329a511a4d845df967e98e26c9a5bf53] | committer: Michael Niedermayer avcodec/dvdsub_parser: never return 0 when the input isnt 0 Fixes a infinite loop Fixes Ticket3804 Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit cfdb30d2f1241de9354a8efdbf8252d0f1a6f933) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8d48223a329a511a4d845df967e98e26c9a5bf53 --- libavcodec/dvdsub_parser.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/dvdsub_parser.c b/libavcodec/dvdsub_parser.c index e50c339..9a6457e 100644 --- a/libavcodec/dvdsub_parser.c +++ b/libavcodec/dvdsub_parser.c @@ -46,7 +46,7 @@ static int dvdsub_parse(AVCodecParserContext *s, if (pc-packet_index == 0) { if (buf_size 2) -return 0; +return buf_size; pc-packet_len = AV_RB16(buf); if (pc-packet_len == 0) /* HD-DVD subpicture packet */ pc-packet_len = AV_RB32(buf+2); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/snow: check coeffs for validity
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Sat Aug 30 02:12:10 2014 +0200| [d76c9b5665a87be003adf9c88cbc902099c90fc4] | committer: Michael Niedermayer avcodec/snow: check coeffs for validity Fixes deadlock Fixes integer overflow Fixes Ticket 3892 Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 596636a474ab201badaae269f3a2cef4824b8c1f) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d76c9b5665a87be003adf9c88cbc902099c90fc4 --- libavcodec/snow.h |9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libavcodec/snow.h b/libavcodec/snow.h index 6335c5d..dace5e3 100644 --- a/libavcodec/snow.h +++ b/libavcodec/snow.h @@ -654,7 +654,10 @@ static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, i if(v){ v= 2*(get_symbol2(s-c, b-state[context + 2], context-4) + 1); v+=get_rac(s-c, b-state[0][16 + 1 + 3 + ff_quant3bA[l0xFF] + 3*ff_quant3bA[t0xFF]]); - +if ((uint16_t)v != v) { +av_log(s-avctx, AV_LOG_ERROR, Coefficient damaged\n); +v = 1; +} xc-x=x; (xc++)-coeff= v; } @@ -664,6 +667,10 @@ static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, i else run= INT_MAX; v= 2*(get_symbol2(s-c, b-state[0 + 2], 0-4) + 1); v+=get_rac(s-c, b-state[0][16 + 1 + 3]); +if ((uint16_t)v != v) { +av_log(s-avctx, AV_LOG_ERROR, Coefficient damaged\n); +v = 1; +} xc-x=x; (xc++)-coeff= v; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avutil/x86/cpu: fix cpuid sub-leaf selection
ffmpeg | branch: release/2.0 | lvqcl lvqcl.m...@gmail.com | Sat Sep 27 13:21:31 2014 +0200| [2eda0e705a286107b9861c51cccd724665a176eb] | committer: Michael Niedermayer avutil/x86/cpu: fix cpuid sub-leaf selection Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit e58fc44649d07d523fcd17aa10d9eb0d3a5ef3f4) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2eda0e705a286107b9861c51cccd724665a176eb --- libavutil/x86/cpu.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/x86/cpu.c b/libavutil/x86/cpu.c index a3a5239..9f8d749 100644 --- a/libavutil/x86/cpu.c +++ b/libavutil/x86/cpu.c @@ -44,7 +44,7 @@ cpuid \n\t \ xchg %%REG_b, %%REG_S \ : =a (eax), =S (ebx), =c (ecx), =d (edx)\ -: 0 (index)) +: 0 (index), 2(0)) #define xgetbv(index, eax, edx) \ __asm__ (.byte 0x0f, 0x01, 0xd0 : =a(eax), =d(edx) : c (index)) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/cinepak: fix integer underflow
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Fri Oct 3 19:33:01 2014 +0200| [97fdbd12f9093366a9a7f870b3ba17771f1e3419] | committer: Michael Niedermayer avcodec/cinepak: fix integer underflow Fixes out of array access Fixes: asan_heap-oob_4da0ba_6_asan_heap-oob_4da0ba_241_cvid_crash.avi Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit e7e5114c506957f40aafd794e06de1a7e341e9d5) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=97fdbd12f9093366a9a7f870b3ba17771f1e3419 --- libavcodec/cinepak.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c index f5bc113..4a6e143 100644 --- a/libavcodec/cinepak.c +++ b/libavcodec/cinepak.c @@ -135,7 +135,7 @@ static int cinepak_decode_vectors (CinepakContext *s, cvid_strip *strip, const uint8_t *eod = (data + size); uint32_t flag, mask; uint8_t *cb0, *cb1, *cb2, *cb3; -unsigned int x, y; +int x, y; char*ip0, *ip1, *ip2, *ip3; flag = 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec: fix aac/ac3 parser bitstream buffer size
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Fri Aug 22 01:15:57 2014 +0200| [9fc7de8d8030156cedeea0d894019fe6e3f20425] | committer: Michael Niedermayer avcodec: fix aac/ac3 parser bitstream buffer size Buffers containing copies of the AAC and AC3 header bits were not padded before parsing, violating init_get_bits() buffer padding requirement, leading to potential buffer read overflows. This change adds FF_INPUT_BUFFER_PADDING_SIZE bytes to the bit buffer for parsing the header in each of aac_parser.c and ac3_parser.c. Based on patch by: Matt Wolenetz wolen...@chromium.org Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit fccd85b9f30525f88692f53134eba41f1f2d90db) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9fc7de8d8030156cedeea0d894019fe6e3f20425 --- libavcodec/aac_parser.c |2 +- libavcodec/ac3_parser.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/aac_parser.c b/libavcodec/aac_parser.c index ab6ca4e..cb93ba9 100644 --- a/libavcodec/aac_parser.c +++ b/libavcodec/aac_parser.c @@ -34,7 +34,7 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info, int size; union { uint64_t u64; -uint8_t u8[8]; +uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE]; } tmp; tmp.u64 = av_be2ne64(state); diff --git a/libavcodec/ac3_parser.c b/libavcodec/ac3_parser.c index 8dc4c0d..acfbc2e 100644 --- a/libavcodec/ac3_parser.c +++ b/libavcodec/ac3_parser.c @@ -147,7 +147,7 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info, int err; union { uint64_t u64; -uint8_t u8[8]; +uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE]; } tmp = { av_be2ne64(state) }; AC3HeaderInfo hdr; GetBitContext gbc; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] proresenc_kostya: remove unneeded parameters
ffmpeg | branch: release/2.0 | Christophe Gisquet christophe.gisq...@gmail.com | Mon Aug 11 22:06:07 2014 +| [b469fce85d8a0278ea489e6d333ae6b0513c9861] | committer: Michael Niedermayer proresenc_kostya: remove unneeded parameters Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit bf10f09bccdcfdb41b9f5bbae01d55961bfd0693) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b469fce85d8a0278ea489e6d333ae6b0513c9861 --- libavcodec/proresenc_kostya.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index 92a5f3b..d80280b 100644 --- a/libavcodec/proresenc_kostya.c +++ b/libavcodec/proresenc_kostya.c @@ -470,7 +470,6 @@ static void put_alpha_run(PutBitContext *pb, int run) // todo alpha quantisation for high quants static int encode_alpha_plane(ProresContext *ctx, PutBitContext *pb, - const uint16_t *src, int linesize, int mbs_per_slice, uint16_t *blocks, int quant) { @@ -565,7 +564,7 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic, get_alpha_data(ctx, src, linesize, xp, yp, pwidth, avctx-height / ctx-pictures_per_frame, ctx-blocks[0], mbs_per_slice, ctx-alpha_bits); -sizes[i] = encode_alpha_plane(ctx, pb, src, linesize, +sizes[i] = encode_alpha_plane(ctx, pb, mbs_per_slice, ctx-blocks[0], quant); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/utils: Add case for jv to avcodec_align_dimensions2()
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Fri Oct 3 04:30:58 2014 +0200| [ac82e318bb81933a427efa1038a24483c00c77a8] | committer: Michael Niedermayer avcodec/utils: Add case for jv to avcodec_align_dimensions2() Fixes out of array accesses Fixes: asan_heap-oob_12304aa_8_asan_heap-oob_4da4f3_300_intro.jv Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 105654e376a736d243aef4a1d121abebce912e6b) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ac82e318bb81933a427efa1038a24483c00c77a8 --- libavcodec/utils.c |4 1 file changed, 4 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 7f6792d..a6de45c 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -291,6 +291,10 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, w_align = 4; h_align = 4; } +if (s-codec_id == AV_CODEC_ID_JV) { +w_align = 8; +h_align = 8; +} break; case AV_PIX_FMT_BGR24: if ((s-codec_id == AV_CODEC_ID_MSZH) || ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/pngdec: Check bits per pixel before setting monoblack pixel format
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Fri Oct 3 17:35:58 2014 +0200| [ae81d9a7da10ee51e229b7e28da4a862888fbdde] | committer: Michael Niedermayer avcodec/pngdec: Check bits per pixel before setting monoblack pixel format Fixes out of array accesses Fixes: asan_heap-oob_14dbfcf_4_asan_heap-oob_1ce5767_179_add_method_small.png Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 3e2b745020c2dbf0201fe7df3dad9e7e0b2e1bb6) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ae81d9a7da10ee51e229b7e28da4a862888fbdde --- libavcodec/pngdec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 1358ac5..016dff9 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -623,7 +623,7 @@ static int decode_frame(AVCodecContext *avctx, } else if ((s-bits_per_pixel == 1 || s-bits_per_pixel == 2 || s-bits_per_pixel == 4 || s-bits_per_pixel == 8) s-color_type == PNG_COLOR_TYPE_PALETTE) { avctx-pix_fmt = AV_PIX_FMT_PAL8; -} else if (s-bit_depth == 1) { +} else if (s-bit_depth == 1 s-bits_per_pixel == 1) { avctx-pix_fmt = AV_PIX_FMT_MONOBLACK; } else if (s-bit_depth == 8 s-color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/jpeglsdec: Check run value more completely in ls_decode_line()
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Thu Oct 2 23:17:21 2014 +0200| [3f9a148022ef0473e96d75add7f04a3e020ebbaa] | committer: Michael Niedermayer avcodec/jpeglsdec: Check run value more completely in ls_decode_line() previously it could have been by 1 too large Fixes out of array access Fixes: asan_heap-oob_12240f5_1_asan_heap-oob_12240f5_448_t8c1e3.jls Fixes: asan_heap-oob_12240f5_1_asan_heap-oob_12240f5_448_t8nde0.jls Fixes: asan_heap-oob_12240fa_1_asan_heap-oob_12240fa_448_t16e3.jls Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 06e7d58410a17dc72c30ee7f3145fcacc425f4f2) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3f9a148022ef0473e96d75add7f04a3e020ebbaa --- libavcodec/jpeglsdec.c |5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c index 894dd42..c2179e5 100644 --- a/libavcodec/jpeglsdec.c +++ b/libavcodec/jpeglsdec.c @@ -217,6 +217,11 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s, x += stride; } +if (x = w) { +av_log(NULL, AV_LOG_ERROR, run overflow\n); +return; +} + /* decode run termination value */ Rb = R(last, x); RItype = (FFABS(Ra - Rb) = state-near) ? 1 : 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] apetag: Fix APE tag size check
ffmpeg | branch: release/2.0 | Katerina Barone-Adesi kateri...@gmail.com | Tue Sep 16 01:40:24 2014 +0200| [47fe68eec82106606e4b9fec20245fde33204315] | committer: Michael Niedermayer apetag: Fix APE tag size check The size variable is (correctly) unsigned, but is passed to several functions which take signed parameters, such as avio_read, sometimes after having numbers added to it. So ensure that size remains within the bounds that these functions can handle. CC: libav-sta...@libav.org Signed-off-by: Diego Biurrun di...@biurrun.de (cherry picked from commit c5560e72d0bb69f8a1ac9536570398f84388f396) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=47fe68eec82106606e4b9fec20245fde33204315 --- libavformat/apetag.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/apetag.c b/libavformat/apetag.c index ab93736..6b7c01e 100644 --- a/libavformat/apetag.c +++ b/libavformat/apetag.c @@ -53,8 +53,10 @@ static int ape_tag_read_field(AVFormatContext *s) av_log(s, AV_LOG_WARNING, Invalid APE tag key '%s'.\n, key); return -1; } -if (size = UINT_MAX) -return -1; +if (size INT32_MAX - FF_INPUT_BUFFER_PADDING_SIZE) { +av_log(s, AV_LOG_ERROR, APE tag size too large.\n); +return AVERROR_INVALIDDATA; +} if (flags APE_TAG_FLAG_IS_BINARY) { uint8_t filename[1024]; enum AVCodecID id; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/tiff: more completely check bpp/bppcount
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Fri Oct 3 16:08:32 2014 +0200| [abbfc4d87ec4a420b06425baf89ae961e1a41e74] | committer: Michael Niedermayer avcodec/tiff: more completely check bpp/bppcount Fixes pixel format selection Fixes out of array accesses Fixes: asan_heap-oob_1766029_6_asan_heap-oob_20aa045_332_cov_1823216757_m2-d1d366d7965db766c19a66c7a2ccbb6b.tif Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit e1c0cfaa419aa5d320540d5a1b3f8fd9b82ab7e5) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=abbfc4d87ec4a420b06425baf89ae961e1a41e74 --- libavcodec/tiff.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index fdfa8f2..b258aa4 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -748,13 +748,13 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame) s-height = value; break; case TIFF_BPP: -s-bppcount = count; -if (count 4) { +if (count 4U) { av_log(s-avctx, AV_LOG_ERROR, This format is not supported (bpp=%d, %d components)\n, - s-bpp, count); + value, count); return AVERROR_INVALIDDATA; } +s-bppcount = count; if (count == 1) s-bpp = value; else { @@ -775,6 +775,13 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame) s-bpp = -1; } } +if (s-bpp 64U) { +av_log(s-avctx, AV_LOG_ERROR, + This format is not supported (bpp=%d, %d components)\n, + s-bpp, count); +s-bpp = 0; +return AVERROR_INVALIDDATA; +} break; case TIFF_SAMPLES_PER_PIXEL: if (count != 1) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/h264: Check mode before considering mixed mode intra prediction
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Sat Oct 4 14:51:46 2014 +0200| [0e7173826216384b56192be3ccdbccb488d7c977] | committer: Michael Niedermayer avcodec/h264: Check mode before considering mixed mode intra prediction Fixes out of array read Fixes: asan_heap-oob_e476fc_2_asan_heap-oob_1333ec6_61_CAMACI3_Sony_C.jsv Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 9734a7a1de3043f012ad0f1ef11027d9488067e6) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0e7173826216384b56192be3ccdbccb488d7c977 --- libavcodec/h264.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 7227e1e..5e92b30 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -500,18 +500,18 @@ int ff_h264_check_intra_pred_mode(H264Context *h, int mode, int is_chroma) if ((h-left_samples_available 0x8080) != 0x8080) { mode = left[mode]; -if (is_chroma (h-left_samples_available 0x8080)) { -// mad cow disease mode, aka MBAFF + constrained_intra_pred -mode = ALZHEIMER_DC_L0T_PRED8x8 + - (!(h-left_samples_available 0x8000)) + - 2 * (mode == DC_128_PRED8x8); -} if (mode 0) { av_log(h-avctx, AV_LOG_ERROR, left block unavailable for requested intra mode at %d %d\n, h-mb_x, h-mb_y); return -1; } +if (is_chroma (h-left_samples_available 0x8080)) { +// mad cow disease mode, aka MBAFF + constrained_intra_pred +mode = ALZHEIMER_DC_L0T_PRED8x8 + + (!(h-left_samples_available 0x8000)) + + 2 * (mode == DC_128_PRED8x8); +} } return mode; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/mjpegdec: check bits per pixel for changes similar to dimensions
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Fri Oct 3 01:50:27 2014 +0200| [49d69844f500e20708a86ae840e809538ba6c6ce] | committer: Michael Niedermayer avcodec/mjpegdec: check bits per pixel for changes similar to dimensions Fixes out of array accesses Fixes: asan_heap-oob_16668e9_2_asan_heap-oob_16668e9_346_miss_congeniality_pegasus_mjpg.avi Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 5c378d6a6df8243f06c87962b873bd563e58cd39) Conflicts: libavcodec/mjpegdec.c (cherry picked from commit 94371a404c663c3dae3d542fa43951567ab67f82) Conflicts: libavcodec/mjpegdec.c http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=49d69844f500e20708a86ae840e809538ba6c6ce --- libavcodec/mjpegdec.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 6a61315..8955774 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -212,7 +212,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s) int ff_mjpeg_decode_sof(MJpegDecodeContext *s) { -int len, nb_components, i, width, height, pix_fmt_id; +int len, nb_components, i, width, height, bits, pix_fmt_id; int h_count[MAX_COMPONENTS]; int v_count[MAX_COMPONENTS]; @@ -221,14 +221,14 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) /* XXX: verify len field validity */ len = get_bits(s-gb, 16); -s-bits = get_bits(s-gb, 8); +bits = get_bits(s-gb, 8); if (s-pegasus_rct) -s-bits = 9; -if (s-bits == 9 !s-pegasus_rct) +bits = 9; +if (bits == 9 !s-pegasus_rct) s-rct = 1;// FIXME ugly -if (s-bits != 8 !s-lossless) { +if (bits != 8 !s-lossless) { av_log(s-avctx, AV_LOG_ERROR, only 8 bits/component accepted\n); return -1; } @@ -259,7 +259,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) return AVERROR_INVALIDDATA; } } -if (s-ls !(s-bits = 8 || nb_components == 1)) { +if (s-ls !(bits = 8 || nb_components == 1)) { avpriv_report_missing_feature(s-avctx, JPEG-LS that is not = 8 bits/component or 16-bit gray); @@ -305,11 +305,13 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) /* if different size, realloc/alloc picture */ if ( width != s-width || height != s-height +|| bits != s-bits || memcmp(s-h_count, h_count, sizeof(h_count)) || memcmp(s-v_count, v_count, sizeof(v_count))) { s-width = width; s-height = height; +s-bits = bits; memcpy(s-h_count, h_count, sizeof(h_count)); memcpy(s-v_count, v_count, sizeof(v_count)); s-interlaced = 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mpegts: Check desc_len / get8() return code
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Sat Oct 4 04:29:40 2014 +0200| [128b0510e1596058fd65c23c274c9cf1b88956fb] | committer: Michael Niedermayer avformat/mpegts: Check desc_len / get8() return code Fixes out of array read Fixes: signal_sigsegv_844d59_10_signal_sigsegv_a17bb7_366_mpegts_mpeg2video_mp2_dvbsub_topfield.rec Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit c3d7f00ee3e09801f56f25db8b5961f25e842bd2) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=128b0510e1596058fd65c23c274c9cf1b88956fb --- libavformat/mpegts.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index f49c2c4..2bb3fdc 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1698,7 +1698,7 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len break; desc_len = get8(p, desc_list_end); desc_end = p + desc_len; -if (desc_end desc_list_end) +if (desc_len 0 || desc_end desc_list_end) break; av_dlog(ts-stream, tag: 0x%02x len=%d\n, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/mpegvideo: Set err on failure in ff_mpv_common_frame_size_change()
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Sun Sep 7 14:14:52 2014 +0200| [beb83f0a40708c95a6420ca15fcf4f1dd0a2c1be] | committer: Michael Niedermayer avcodec/mpegvideo: Set err on failure in ff_mpv_common_frame_size_change() Found-by: ubitux Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit cfce6f7efd28130bf0dd409b2367ca0f8c9b2417) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=beb83f0a40708c95a6420ca15fcf4f1dd0a2c1be --- libavcodec/mpegvideo.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 8091382..1a115d3 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -1214,7 +1214,7 @@ int ff_MPV_common_frame_size_change(MpegEncContext *s) s-mb_height = (s-height + 15) / 16; if ((s-width || s-height) -av_image_check_size(s-width, s-height, 0, s-avctx)) +(err = av_image_check_size(s-width, s-height, 0, s-avctx)) 0) goto fail; if ((err = init_context_frame(s))) @@ -1231,7 +1231,7 @@ int ff_MPV_common_frame_size_change(MpegEncContext *s) } for (i = 0; i nb_slices; i++) { -if (init_duplicate_context(s-thread_context[i]) 0) +if ((err = init_duplicate_context(s-thread_context[i])) 0) goto fail; s-thread_context[i]-start_mb_y = (s-mb_height * (i) + nb_slices / 2) / nb_slices; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/pngdec: Calculate MPNG bytewidth more defensively
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Fri Oct 3 17:54:21 2014 +0200| [db48767d7c16f3b9661235a0ed95a2347b0f4226] | committer: Michael Niedermayer avcodec/pngdec: Calculate MPNG bytewidth more defensively Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit e830902934a29df05c7af65aef2a480b15f572c4) Conflicts: libavcodec/pngdec.c http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=db48767d7c16f3b9661235a0ed95a2347b0f4226 --- libavcodec/pngdec.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 016dff9..c4fc422 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -829,9 +829,10 @@ static int decode_frame(AVCodecContext *avctx, int i, j; uint8_t *pd = p-data[0]; uint8_t *pd_last = s-prev-data[0]; +int ls = FFMIN(av_image_get_linesize(p-format, s-width, 0), s-width * s-bpp); for (j = 0; j s-height; j++) { -for (i = 0; i s-width * s-bpp; i++) { +for (i = 0; i ls; i++) { pd[i] += pd_last[i]; } pd += s-image_linesize; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/svq3: Dont memcpy AVFrame
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Sat Oct 4 00:13:26 2014 +0200| [ff59edb6dcd7e695b28335c5f718fb7342823714] | committer: Michael Niedermayer avcodec/svq3: Dont memcpy AVFrame This avoids out of array accesses Fixes: asan_heap-uaf_21f42e4_9_asan_heap-uaf_21f42e4_278_gl2.mov Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 075a165d2715837d125a9cc714fb430ccf6c9d6b) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ff59edb6dcd7e695b28335c5f718fb7342823714 --- libavcodec/svq3.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 3da341e..5e8e107 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -1147,7 +1147,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data, h-cur_pic_ptr = s-cur_pic; av_frame_unref(h-cur_pic.f); -h-cur_pic = *s-cur_pic; +memcpy(h-cur_pic.tf, s-cur_pic-tf, sizeof(h-cur_pic) - offsetof(Picture, tf)); ret = av_frame_ref(h-cur_pic.f, s-cur_pic-f); if (ret 0) return ret; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/mmvideo: Bounds check 2nd line of HHV Intra blocks
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Fri Oct 3 14:45:04 2014 +0200| [16775c7aaa0798c396036e55336fc5c087cc202e] | committer: Michael Niedermayer avcodec/mmvideo: Bounds check 2nd line of HHV Intra blocks Fixes out of array access Fixes: asan_heap-oob_4da4f3_8_asan_heap-oob_4da4f3_419_scene1a.mm Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 8b0e96e1f21b761ca15dbb470cd619a1ebf86c3e) Conflicts: libavcodec/mmvideo.c http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=16775c7aaa0798c396036e55336fc5c087cc202e --- libavcodec/mmvideo.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c index 292ebe6..f028e57 100644 --- a/libavcodec/mmvideo.c +++ b/libavcodec/mmvideo.c @@ -109,7 +109,7 @@ static int mm_decode_intra(MmContext * s, int half_horiz, int half_vert) if (color) { memset(s-frame.data[0] + y*s-frame.linesize[0] + x, color, run_length); -if (half_vert) +if (half_vert y + half_vert s-avctx-height) memset(s-frame.data[0] + (y+1)*s-frame.linesize[0] + x, color, run_length); } x+= run_length; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/gifdec: factorize interleave end handling out
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Fri Oct 3 20:15:52 2014 +0200| [be7105dff61e3356459546ea952c0ea795674106] | committer: Michael Niedermayer avcodec/gifdec: factorize interleave end handling out also change it to a loop Fixes out of array access Fixes: asan_heap-oob_ca5410_8_asan_heap-oob_ca5410_97_ID_LSD_Size_Less_Then_Data_Inter_3.gif Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 8f1457864be8fb9653643519dea1c6492f1dde57) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=be7105dff61e3356459546ea952c0ea795674106 --- libavcodec/gifdec.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c index 4c1cb83..a7a5696 100644 --- a/libavcodec/gifdec.c +++ b/libavcodec/gifdec.c @@ -251,26 +251,21 @@ static int gif_read_image(GifState *s, AVFrame *frame) case 1: y1 += 8; ptr += linesize * 8; -if (y1 = height) { -y1 = pass ? 2 : 4; -ptr = ptr1 + linesize * y1; -pass++; -} break; case 2: y1 += 4; ptr += linesize * 4; -if (y1 = height) { -y1 = 1; -ptr = ptr1 + linesize; -pass++; -} break; case 3: y1 += 2; ptr += linesize * 2; break; } +while (y1 = height) { +y1 = 4 pass; +ptr = ptr1 + linesize * y1; +pass++; +} } else { ptr += linesize; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/ac3enc_template: fix out of array read
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Sat Sep 27 20:34:44 2014 +0200| [52fd0cda2cdd20d89d3a59401379b7befa998688] | committer: Michael Niedermayer avcodec/ac3enc_template: fix out of array read Found-by: Andreas Cadhalpun Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit d85ebea3f3b68ebccfe308fa839fc30fa634e4de) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=52fd0cda2cdd20d89d3a59401379b7befa998688 --- libavcodec/ac3enc_template.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/ac3enc_template.c b/libavcodec/ac3enc_template.c index 0389c2e..76d42a2 100644 --- a/libavcodec/ac3enc_template.c +++ b/libavcodec/ac3enc_template.c @@ -260,7 +260,7 @@ static void apply_channel_coupling(AC3EncodeContext *s) energy_cpl = energy[blk][CPL_CH][bnd]; energy_ch = energy[blk][ch][bnd]; blk1 = blk+1; -while (!s-blocks[blk1].new_cpl_coords[ch] blk1 s-num_blocks) { +while (blk1 s-num_blocks !s-blocks[blk1].new_cpl_coords[ch]) { if (s-blocks[blk1].cpl_in_use) { energy_cpl += energy[blk1][CPL_CH][bnd]; energy_ch += energy[blk1][ch][bnd]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] configure: add noexecstack to linker options if supported.
ffmpeg | branch: release/2.0 | Reimar Döffinger reimar.doeffin...@gmx.de | Sun Sep 21 09:58:10 2014 +0100| [8622618839c6fc9a3e2f8fcd3889bfce79fbb762] | committer: Michael Niedermayer configure: add noexecstack to linker options if supported. Signed-off-by: Reimar Döffinger reimar.doeffin...@gmx.de (cherry picked from commit b7082d953fda93f7841e7d15a6c3cd15bdee) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8622618839c6fc9a3e2f8fcd3889bfce79fbb762 --- configure |1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 43b4937..5ed0ddc 100755 --- a/configure +++ b/configure @@ -3957,6 +3957,7 @@ EOF fi check_ldflags -Wl,--as-needed +check_ldflags -Wl,-z,noexecstack if check_func dlopen; then ldl= ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/mpegvideo: Use goto fail for all error paths in ff_mpv_common_frame_size_change()
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Sun Sep 7 12:52:24 2014 +0200| [6e70816f719125a630fcb8ce7e67c0c7136e7655] | committer: Michael Niedermayer avcodec/mpegvideo: Use goto fail for all error paths in ff_mpv_common_frame_size_change() Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 2762323c37511fbbc98b164c07620b9ebc59ec68) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6e70816f719125a630fcb8ce7e67c0c7136e7655 --- libavcodec/mpegvideo.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index d497864..666fcca 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -1212,7 +1212,7 @@ int ff_MPV_common_frame_size_change(MpegEncContext *s) if ((s-width || s-height) av_image_check_size(s-width, s-height, 0, s-avctx)) -return AVERROR_INVALIDDATA; +goto fail; if ((err = init_context_frame(s))) goto fail; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] postproc/postprocess: fix quant store for fq mode
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Sun Oct 12 20:26:27 2014 +0200| [d7906baa85978c052475d8ea2f8391c031649400] | committer: Michael Niedermayer postproc/postprocess: fix quant store for fq mode Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 941aaa39e8cd78ba4d16dfcec767290aec9a0136) Conflicts: tests/ref/fate/filter-pp3 (cherry picked from commit 705748caf3f6a4a3e74ad3d2fc547a5a0213a521) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d7906baa85978c052475d8ea2f8391c031649400 --- libpostproc/postprocess.c |2 +- tests/ref/fate/filter-pp3 |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index b34943f..fb18776 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -1000,7 +1000,7 @@ void pp_postprocess(const uint8_t * src[3], const int srcStride[3], if((pict_type7)!=3){ if (QPStride = 0){ int i; -const int count= mbHeight * QPStride; +const int count= mbHeight * FFMAX(QPStride, mbWidth); for(i=0; i(count2); i++){ ((uint32_t*)c-nonBQPTable)[i] = ((const uint32_t*)QP_store)[i] 0x3F3F3F3F; } diff --git a/tests/ref/fate/filter-pp3 b/tests/ref/fate/filter-pp3 index ccf2eeb..1af8761 100644 --- a/tests/ref/fate/filter-pp3 +++ b/tests/ref/fate/filter-pp3 @@ -1 +1 @@ -pp3 39af1a30d0ea0e906df264773adfcaa6 +pp3 c8277ef31ab01bad51356841c9634522 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/libilbc: support for latest git of libilbc
ffmpeg | branch: release/2.0 | Gianluigi Tiesi mpla...@netfarm.it | Fri Sep 19 04:49:36 2014 +0200| [f238de19905364993921fa83daf35e5e59d50d56] | committer: Michael Niedermayer avcodec/libilbc: support for latest git of libilbc in the latest git commits of libilbc developers removed WebRtc_xxx typedefs This commit uses int types instead, it's safe to apply also for previous versions since WebRtc_Word16 was always a typedef of int16_t and WebRtc_UWord16 a typedef of uint16_t Reviewed-by: Timothy Gu timothyg...@gmail.com Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 59af5383c18c8cf3fe2a4b5cc1ebf2f3300bdfe5) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f238de19905364993921fa83daf35e5e59d50d56 --- libavcodec/libilbc.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/libilbc.c b/libavcodec/libilbc.c index b4163c6..d0d92e3 100644 --- a/libavcodec/libilbc.c +++ b/libavcodec/libilbc.c @@ -96,8 +96,7 @@ static int ilbc_decode_frame(AVCodecContext *avctx, void *data, if ((ret = ff_get_buffer(avctx, frame, 0)) 0) return ret; -WebRtcIlbcfix_DecodeImpl((WebRtc_Word16*) frame-data[0], - (const WebRtc_UWord16*) buf, s-decoder, 1); +WebRtcIlbcfix_DecodeImpl((int16_t *) frame-data[0], (const uint16_t *) buf, s-decoder, 1); *got_frame_ptr = 1; @@ -170,7 +169,7 @@ static int ilbc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, if ((ret = ff_alloc_packet2(avctx, avpkt, 50)) 0) return ret; -WebRtcIlbcfix_EncodeImpl((WebRtc_UWord16*) avpkt-data, (const WebRtc_Word16*) frame-data[0], s-encoder); +WebRtcIlbcfix_EncodeImpl((uint16_t *) avpkt-data, (const int16_t *) frame-data[0], s-encoder); avpkt-size = s-encoder.no_of_bytes; *got_packet_ptr = 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dirac_arith: fix integer overflow
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Tue Oct 28 02:14:41 2014 +0100| [2cf83677b31453868b090e898bb66809b8d18b63] | committer: Michael Niedermayer avcodec/dirac_arith: fix integer overflow Fixes: asan_heap-oob_1078676_9_008.drc Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 39680caceebfc6abf09b17032048752c014e57a8) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2cf83677b31453868b090e898bb66809b8d18b63 --- libavcodec/dirac_arith.h |4 1 file changed, 4 insertions(+) diff --git a/libavcodec/dirac_arith.h b/libavcodec/dirac_arith.h index 089c71a..a1fa96b 100644 --- a/libavcodec/dirac_arith.h +++ b/libavcodec/dirac_arith.h @@ -171,6 +171,10 @@ static inline int dirac_get_arith_uint(DiracArith *c, int follow_ctx, int data_c { int ret = 1; while (!dirac_get_arith_bit(c, follow_ctx)) { +if (ret = 0x4000) { +av_log(NULL, AV_LOG_ERROR, dirac_get_arith_uint overflow\n); +return -1; +} ret = 1; ret += dirac_get_arith_bit(c, data_ctx); follow_ctx = ff_dirac_next_ctx[follow_ctx]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/diracdec: Tighter checks on CODEBLOCKS_X/Y
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Tue Oct 28 01:23:40 2014 +0100| [c0be9d7264400f8eb8648fd0b0ad00819e376163] | committer: Michael Niedermayer avcodec/diracdec: Tighter checks on CODEBLOCKS_X/Y Fixes very long but finite loop Fixes: asan_heap-oob_107866c_42_041.drc Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 5145d22b88b9835db81c4d286b931a78e08ab76a) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c0be9d7264400f8eb8648fd0b0ad00819e376163 --- libavcodec/diracdec.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index 9c6fbc7..02ec30b 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -990,8 +990,8 @@ static int dirac_unpack_idwt_params(DiracContext *s) /* Codeblock parameters (core syntax only) */ if (get_bits1(gb)) { for (i = 0; i = s-wavelet_depth; i++) { -CHECKEDREAD(s-codeblock[i].width , tmp 1, codeblock width invalid\n) -CHECKEDREAD(s-codeblock[i].height, tmp 1, codeblock height invalid\n) +CHECKEDREAD(s-codeblock[i].width , tmp 1 || tmp (s-avctx-width s-wavelet_depth-i), codeblock width invalid\n) +CHECKEDREAD(s-codeblock[i].height, tmp 1 || tmp (s-avctx-heights-wavelet_depth-i), codeblock height invalid\n) } CHECKEDREAD(s-codeblock_mode, tmp 1, unknown codeblock mode\n) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swresample/swresample: fix sample drop loop end condition
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Mon Oct 6 01:08:20 2014 +0200| [322470e606334bdbda7993a44acc1955fb00fdec] | committer: Michael Niedermayer swresample/swresample: fix sample drop loop end condition Fixes Ticket3985 Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit f9fefa499f0af48f47ea73c8ce0b25df0976c315) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=322470e606334bdbda7993a44acc1955fb00fdec --- libswresample/swresample.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libswresample/swresample.c b/libswresample/swresample.c index ba2afdb..c534ccf 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -752,6 +752,8 @@ int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_coun in_count = 0; if(ret0) { s-drop_output -= ret; +if (!s-drop_output !out_arg) +return 0; continue; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/diracdec: Use 64bit in calculation of codeblock coordinates
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Tue Oct 28 01:23:40 2014 +0100| [70402f6ee78606b8fc864ad3d10a44d0a60c] | committer: Michael Niedermayer avcodec/diracdec: Use 64bit in calculation of codeblock coordinates Fixes integer overflow Fixes out of array read Fixes: asan_heap-oob_107866c_42_041.drc Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 526886e6069636a918c8c04db17e864e3d8151c1) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=70402f6ee78606b8fc864ad3d10a44d0a60c --- libavcodec/diracdec.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index 5653c86..9c6fbc7 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -598,10 +598,10 @@ static av_always_inline void decode_subband_internal(DiracContext *s, SubBand *b top = 0; for (cb_y = 0; cb_y cb_height; cb_y++) { -bottom = (b-height * (cb_y+1)) / cb_height; +bottom = (b-height * (cb_y+1LL)) / cb_height; left = 0; for (cb_x = 0; cb_x cb_width; cb_x++) { -right = (b-width * (cb_x+1)) / cb_width; +right = (b-width * (cb_x+1LL)) / cb_width; codeblock(s, b, gb, c, left, right, top, bottom, blockcnt_one, is_arith); left = right; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dnxhddec: treat pix_fmt like width/height
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Wed Oct 29 00:57:07 2014 +0100| [85cac770bdb0ed871ce5715452f416d16d36d7e8] | committer: Michael Niedermayer avcodec/dnxhddec: treat pix_fmt like width/height Fixes out of array accesses Fixes: asan_heap-oob_22c9a39_16_015.mxf Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit f3c0e0bf6f53df0977f3878d4f5cec99dff8de9e) Conflicts: libavcodec/dnxhddec.c Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=85cac770bdb0ed871ce5715452f416d16d36d7e8 --- libavcodec/dnxhddec.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index e96369b..61d7695 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -35,6 +35,7 @@ typedef struct DNXHDContext { GetBitContext gb; int64_t cid;/// compression id unsigned int width, height; +enum AVPixelFormat pix_fmt; unsigned int mb_width, mb_height; uint32_t mb_scan_index[68]; /* max for 1080p */ int cur_field; /// current interlaced field @@ -128,7 +129,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, av_dlog(ctx-avctx, width %d, height %d\n, ctx-width, ctx-height); if (buf[0x21] 0x40) { -ctx-avctx-pix_fmt = AV_PIX_FMT_YUV422P10; +ctx-pix_fmt = AV_PIX_FMT_YUV422P10; ctx-avctx-bits_per_raw_sample = 10; if (ctx-bit_depth != 10) { ff_dsputil_init(ctx-dsp, ctx-avctx); @@ -136,7 +137,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, ctx-decode_dct_block = dnxhd_decode_dct_block_10; } } else { -ctx-avctx-pix_fmt = AV_PIX_FMT_YUV422P; +ctx-pix_fmt = AV_PIX_FMT_YUV422P; ctx-avctx-bits_per_raw_sample = 8; if (ctx-bit_depth != 8) { ff_dsputil_init(ctx-dsp, ctx-avctx); @@ -376,9 +377,15 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, avctx-width, avctx-height, ctx-width, ctx-height); first_field = 1; } +if (avctx-pix_fmt != AV_PIX_FMT_NONE avctx-pix_fmt != ctx-pix_fmt) { +av_log(avctx, AV_LOG_WARNING, pix_fmt changed: %s - %s\n, + av_get_pix_fmt_name(avctx-pix_fmt), av_get_pix_fmt_name(ctx-pix_fmt)); +first_field = 1; +} if (av_image_check_size(ctx-width, ctx-height, 0, avctx)) return -1; +avctx-pix_fmt = ctx-pix_fmt; avcodec_set_dimensions(avctx, ctx-width, ctx-height); if (first_field) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] postproc: fix qp count
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Mon Oct 13 16:02:42 2014 +0200| [9b1673531cf92447ab1e03ad62c7ae4487c5ee0e] | committer: Michael Niedermayer postproc: fix qp count Found-by: ubitux Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 0b7e5d0d75e7d8762dd04d35f8c0821736164372) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9b1673531cf92447ab1e03ad62c7ae4487c5ee0e --- libpostproc/postprocess.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index fb18776..8e5b043 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -975,7 +975,7 @@ void pp_postprocess(const uint8_t * src[3], const int srcStride[3], if(pict_type PP_PICT_TYPE_QP2){ int i; -const int count= mbHeight * absQPStride; +const int count= FFMAX(mbHeight * absQPStride, mbWidth); for(i=0; i(count2); i++){ ((uint32_t*)c-stdQPTable)[i] = (((const uint32_t*)QP_store)[i]1) 0x7F7F7F7F; } @@ -1000,7 +1000,7 @@ void pp_postprocess(const uint8_t * src[3], const int srcStride[3], if((pict_type7)!=3){ if (QPStride = 0){ int i; -const int count= mbHeight * FFMAX(QPStride, mbWidth); +const int count= FFMAX(mbHeight * QPStride, mbWidth); for(i=0; i(count2); i++){ ((uint32_t*)c-nonBQPTable)[i] = ((const uint32_t*)QP_store)[i] 0x3F3F3F3F; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dxa: check dimensions
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Tue Oct 28 15:26:42 2014 +0100| [808b0ccc03dcdac68eb8b693b5c9a59aa1d62b6d] | committer: Michael Niedermayer avcodec/dxa: check dimensions Fixes out of array access Fixes: asan_heap-oob_11222fb_21_020.dxa Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit e70312dfc22c4e54d5716f28f28db8f99c74cc90) Conflicts: libavcodec/dxa.c http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=808b0ccc03dcdac68eb8b693b5c9a59aa1d62b6d --- libavcodec/dxa.c |5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c index 985b9da..c56c0af2 100644 --- a/libavcodec/dxa.c +++ b/libavcodec/dxa.c @@ -306,6 +306,11 @@ static av_cold int decode_init(AVCodecContext *avctx) avctx-pix_fmt = AV_PIX_FMT_PAL8; +if (avctx-width%4 || avctx-height%4) { +avpriv_request_sample(avctx, dimensions are not a multiple of 4); +return AVERROR_INVALIDDATA; +} + c-prev = av_frame_alloc(); if (!c-prev) return AVERROR(ENOMEM); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/g2meet: check tile dimensions to avoid integer overflow
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Thu Oct 30 01:19:17 2014 +0100| [e2865d931618deb65659343f185a0f77cf000296] | committer: Michael Niedermayer avcodec/g2meet: check tile dimensions to avoid integer overflow Fixes out of array access Fixes: asan_heap-oob_12a55d3_30_029.wmv Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 32e666c354e4a3160d8cf1d303cb51990b095c87) Conflicts: libavcodec/g2meet.c Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e2865d931618deb65659343f185a0f77cf000296 --- libavcodec/g2meet.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c index 1634059..bcf6cb0 100644 --- a/libavcodec/g2meet.c +++ b/libavcodec/g2meet.c @@ -716,7 +716,10 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data, } c-tile_width = bytestream2_get_be32(bc); c-tile_height = bytestream2_get_be32(bc); -if (!c-tile_width || !c-tile_height) { +if (c-tile_width = 0 || c-tile_height = 0 || +((c-tile_width | c-tile_height) 0xF) || +c-tile_width * 4LL * c-tile_height = INT_MAX +) { av_log(avctx, AV_LOG_ERROR, Invalid tile dimensions %dx%d\n, c-tile_width, c-tile_height); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/utils: Align dimensions by at least their chroma sub-sampling factors.
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Wed Oct 29 14:15:29 2014 +0100| [bde9e859b3c7ebb0f76437dd6457a41ac8904740] | committer: Michael Niedermayer avcodec/utils: Align dimensions by at least their chroma sub-sampling factors. Fixes: out of array accesses Fixes: asan_heap-oob_112c6b3_13_012.avi Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit df74811cd53e45fcbbd3b77a1c42416816687c5c) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bde9e859b3c7ebb0f76437dd6457a41ac8904740 --- libavcodec/utils.c |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index a6de45c..8e421e7 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -196,6 +196,12 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int i; int w_align = 1; int h_align = 1; +AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s-pix_fmt); + +if (desc) { +w_align = 1 desc-log2_chroma_w; +h_align = 1 desc-log2_chroma_h; +} switch (s-pix_fmt) { case AV_PIX_FMT_YUV420P: @@ -310,8 +316,6 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, } break; default: -w_align = 1; -h_align = 1; break; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/utvideodec: fix assumtation that slice_height = 1
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Mon Nov 10 19:44:20 2014 +0100| [f8675743c40a468359207903c7b2ec6bc2b4fcbe] | committer: Michael Niedermayer avcodec/utvideodec: fix assumtation that slice_height = 1 Fixes out of array read Fixes: asan_heap-oob_2573085_3783_utvideo_rgba_median.avi Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 7656c4c6e66f8a787d384f027ad824cc1677fda1) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f8675743c40a468359207903c7b2ec6bc2b4fcbe --- libavcodec/utvideodec.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c index 241431c..acc20bf 100644 --- a/libavcodec/utvideodec.c +++ b/libavcodec/utvideodec.c @@ -222,7 +222,7 @@ static void restore_median(uint8_t *src, int step, int stride, A= bsrc[i]; } bsrc += stride; -if (slice_height == 1) +if (slice_height = 1) continue; // second line - first element has top prediction, the rest uses median C= bsrc[-stride]; @@ -282,7 +282,7 @@ static void restore_median_il(uint8_t *src, int step, int stride, A = bsrc[stride + i]; } bsrc += stride2; -if (slice_height == 1) +if (slice_height = 1) continue; // second line - first element has top prediction, the rest uses median C= bsrc[-stride2]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/wmaprodec: Fix integer overflow in sfb_offsets initialization
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Mon Nov 10 23:07:50 2014 +0100| [0baeb59307e68db8c1cfc672093802b46c6ee84f] | committer: Michael Niedermayer avcodec/wmaprodec: Fix integer overflow in sfb_offsets initialization Fixes out of array read Fixes: asan_heap-oob_2aec5b0_1828_classical_22_16_2_16000_v3c_0_exclusive_0_29.wma Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 5dcb99033df16eccc4dbbc4a099ad64457f9f090) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0baeb59307e68db8c1cfc672093802b46c6ee84f --- libavcodec/wmaprodec.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index ca57f64..000659d 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -420,6 +420,9 @@ static av_cold int decode_init(AVCodecContext *avctx) offset = ~3; if (offset s-sfb_offsets[i][band - 1]) s-sfb_offsets[i][band++] = offset; + +if (offset = subframe_len) +break; } s-sfb_offsets[i][band - 1] = subframe_len; s-num_sfb[i] = band - 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/h264_slice: Clear table pointers to avoid stale pointers
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Sun Nov 2 01:55:40 2014 +0100| [0140f11c3bad6f9532e8f0f3c858d08a948bb6b6] | committer: Michael Niedermayer avcodec/h264_slice: Clear table pointers to avoid stale pointers Might fix Ticket3889 Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 547fce95858ef83f8c25ae347e3ae3b8ba437fd9) Conflicts: libavcodec/h264_slice.c Conflicts: libavcodec/h264.c http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0140f11c3bad6f9532e8f0f3c858d08a948bb6b6 --- libavcodec/h264.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 5e92b30..5be363a 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1690,6 +1690,17 @@ static int decode_update_thread_context(AVCodecContext *dst, h-mb_type_pool = NULL; h-ref_index_pool = NULL; h-motion_val_pool = NULL; +h-intra4x4_pred_mode= NULL; +h-non_zero_count= NULL; +h-slice_table_base = NULL; +h-slice_table = NULL; +h-cbp_table = NULL; +h-chroma_pred_mode_table = NULL; +memset(h-mvd_table, 0, sizeof(h-mvd_table)); +h-direct_table = NULL; +h-list_counts = NULL; +h-mb2b_xy = NULL; +h-mb2br_xy = NULL; if (h1-context_initialized) { h-context_initialized = 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/cook: check that the subpacket sizes fit in block_align
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Thu Oct 30 16:53:09 2014 +0100| [8efb06c8735f1ceb47e10a2162209c66fe648b3c] | committer: Michael Niedermayer avcodec/cook: check that the subpacket sizes fit in block_align Fixes out of array read Fixes: asan_heap-oob_fb5c50_19_018.rmvb Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit 10e32618acce9c3fc64c061eb7907e8a8d2749ae) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8efb06c8735f1ceb47e10a2162209c66fe648b3c --- libavcodec/cook.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 08cd401..3344b70 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -1217,8 +1217,8 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) q-num_subpackets++; s++; -if (s MAX_SUBPACKETS) { -avpriv_request_sample(avctx, subpackets %d, MAX_SUBPACKETS); +if (s FFMIN(MAX_SUBPACKETS, avctx-block_align)) { +avpriv_request_sample(avctx, subpackets %d, FFMIN(MAX_SUBPACKETS, avctx-block_align)); return AVERROR_PATCHWELCOME; } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] v4l2enc: adding AVClass
ffmpeg | branch: release/2.0 | Anshul Maheswhwari anshul.ffm...@gmail.com | Thu Jul 31 21:17:59 2014 +0530| [3d10235b83520532a586cf5e3066368b347268f5] | committer: Michael Niedermayer v4l2enc: adding AVClass Signed-off-by: Michael Niedermayer michae...@gmx.at (cherry picked from commit fcb11ec291e9b3e3f352fa4d3e9026c0f7f64aa8) Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3d10235b83520532a586cf5e3066368b347268f5 --- libavdevice/v4l2enc.c |1 + 1 file changed, 1 insertion(+) diff --git a/libavdevice/v4l2enc.c b/libavdevice/v4l2enc.c index 21f0ef6..db49465 100644 --- a/libavdevice/v4l2enc.c +++ b/libavdevice/v4l2enc.c @@ -22,6 +22,7 @@ #include avdevice.h typedef struct { +AVClass *class; int fd; } V4L2Context; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] update for 2.0.6
ffmpeg | branch: release/2.0 | Michael Niedermayer michae...@gmx.at | Fri Nov 14 19:35:38 2014 +0100| [3d91569c5e39f4062393fdb40b038e31df38473a] | committer: Michael Niedermayer update for 2.0.6 Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3d91569c5e39f4062393fdb40b038e31df38473a --- RELEASE |2 +- VERSION |2 +- doc/Doxyfile |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RELEASE b/RELEASE index e010258..157e54f 100644 --- a/RELEASE +++ b/RELEASE @@ -1 +1 @@ -2.0.5 +2.0.6 diff --git a/VERSION b/VERSION index e010258..157e54f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.5 +2.0.6 diff --git a/doc/Doxyfile b/doc/Doxyfile index 0fcf7b0..04340e3 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 2.0.5 +PROJECT_NUMBER = 2.0.6 # With the PROJECT_LOGO tag one can specify an logo or icon that is included # in the documentation. The maximum height of the logo should not exceed 55 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Tag n2.0.6 : FFmpeg 2.0.6 release
[ffmpeg] [branch: refs/tags/n2.0.6] Tag:79740a69c8022ac5fa2641658363afbd33c95809 http://git.videolan.org/gitweb.cgi/ffmpeg.git?a=tag;h=79740a69c8022ac5fa2641658363afbd33c95809 Tagger: Michael Niedermayer michae...@gmx.at Date: Fri Nov 14 23:38:08 2014 +0100 FFmpeg 2.0.6 release ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] [ffmpeg-web] branch master updated. 0acb9ff web/security: add 2.0.6
The branch, master has been updated via 0acb9ffd586100797161f75824bc9fe362d5f564 (commit) from 31b7489f5576c6843f92b4ca0d6ac198189e (commit) - Log - commit 0acb9ffd586100797161f75824bc9fe362d5f564 Author: Michael Niedermayer michae...@gmx.at AuthorDate: Fri Nov 14 23:55:01 2014 +0100 Commit: Michael Niedermayer michae...@gmx.at CommitDate: Fri Nov 14 23:55:01 2014 +0100 web/security: add 2.0.6 diff --git a/src/security b/src/security index a32454c..16d0040 100644 --- a/src/security +++ b/src/security @@ -147,6 +147,23 @@ CVE-2013-7024, fe448cd28d674c3eff3072552eae366d0b659ce9 h2FFmpeg 2.0/h2 +h32.0.6/h3 +p +Fixes following vulnerabilities: +/p +pre +CVE-2014-5271, 57a6cd8ab1c221cad1c2c49ff02216d752684651 / 52b81ff4635c077b2bc8b8d3637d933b6629d803 +CVE-2014-5272, 656f930160db48e0b7b25069c62abc340e7f0628 / 3539d6c63a16e1b2874bb037a86f317449c58770 +CVE-2014-8541, 49d69844f500e20708a86ae840e809538ba6c6ce / 5c378d6a6df8243f06c87962b873bd563e58cd39 +CVE-2014-8542, ac82e318bb81933a427efa1038a24483c00c77a8 / 105654e376a736d243aef4a1d121abebce912e6b +CVE-2014-8543, 16775c7aaa0798c396036e55336fc5c087cc202e / 8b0e96e1f21b761ca15dbb470cd619a1ebf86c3e +CVE-2014-8544, abbfc4d87ec4a420b06425baf89ae961e1a41e74 / e1c0cfaa419aa5d320540d5a1b3f8fd9b82ab7e5 +CVE-2014-8545, ae81d9a7da10ee51e229b7e28da4a862888fbdde / 3e2b745020c2dbf0201fe7df3dad9e7e0b2e1bb6 +CVE-2014-8546, 97fdbd12f9093366a9a7f870b3ba17771f1e3419 / e7e5114c506957f40aafd794e06de1a7e341e9d5 +CVE-2014-8547, be7105dff61e3356459546ea952c0ea795674106 / 8f1457864be8fb9653643519dea1c6492f1dde57 +CVE-2014-8548, b4e0acfa043cbb7991335e1383ba7456dc07d169 / c727401aa9d62335e89d118a5b4e202edf39d905 +/pre + h32.0.5/h3 p Fixes following vulnerabilities: --- Summary of changes: src/security | 17 + 1 files changed, 17 insertions(+), 0 deletions(-) hooks/post-receive -- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '4b39cc1a093c239412ded522c4a899744e7f2008'
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Sat Nov 15 01:45:32 2014 +0100| [720a8d2b7518fd8bf69a5fe470f35dd0cb0aafb6] | committer: Michael Niedermayer Merge commit '4b39cc1a093c239412ded522c4a899744e7f2008' * commit '4b39cc1a093c239412ded522c4a899744e7f2008': riff: support ProRes in avi (APCN fourcc) Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=720a8d2b7518fd8bf69a5fe470f35dd0cb0aafb6 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] riff: support ProRes in avi (APCN fourcc)
ffmpeg | branch: master | Vittorio Giovara vittorio.giov...@gmail.com | Fri Nov 14 14:39:18 2014 +0100| [4b39cc1a093c239412ded522c4a899744e7f2008] | committer: Vittorio Giovara riff: support ProRes in avi (APCN fourcc) http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4b39cc1a093c239412ded522c4a899744e7f2008 --- libavformat/riff.c |1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/riff.c b/libavformat/riff.c index 0e16ec7..b91f8f1 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -347,6 +347,7 @@ const AVCodecTag ff_codec_bmp_tags[] = { { AV_CODEC_ID_G2M, MKTAG('G', '2', 'M', '3') }, { AV_CODEC_ID_G2M, MKTAG('G', '2', 'M', '4') }, { AV_CODEC_ID_FIC, MKTAG('F', 'I', 'C', 'V') }, +{ AV_CODEC_ID_PRORES, MKTAG('A', 'P', 'C', 'N') }, { AV_CODEC_ID_NONE, 0 } }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] bgmc: fix sizeof arguments
ffmpeg | branch: master | Thilo Borgmann thilo.borgm...@googlemail.com | Wed Nov 12 19:10:43 2014 +0100| [e4cb6abb2f46910c72178e2f987a0198f0fd10b1] | committer: Vittorio Giovara bgmc: fix sizeof arguments CC: libav-de...@libav.org Bug-Id: CID 608084 / CID 700724 http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e4cb6abb2f46910c72178e2f987a0198f0fd10b1 --- libavcodec/bgmc.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/bgmc.c b/libavcodec/bgmc.c index c7f732e..ad8baae 100644 --- a/libavcodec/bgmc.c +++ b/libavcodec/bgmc.c @@ -460,8 +460,8 @@ static uint8_t *bgmc_lut_getp(uint8_t *lut, int *lut_status, int delta) av_cold int ff_bgmc_init(AVCodecContext *avctx, uint8_t **cf_lut, int **cf_lut_status) { -*cf_lut= av_malloc(sizeof(*cf_lut)* LUT_BUFF * 16 * LUT_SIZE); -*cf_lut_status = av_malloc(sizeof(*cf_lut_status) * LUT_BUFF); +*cf_lut= av_malloc(sizeof(**cf_lut)* LUT_BUFF * 16 * LUT_SIZE); +*cf_lut_status = av_malloc(sizeof(**cf_lut_status) * LUT_BUFF); if (!*cf_lut || !*cf_lut_status) { ff_bgmc_end(cf_lut, cf_lut_status); @@ -469,7 +469,7 @@ av_cold int ff_bgmc_init(AVCodecContext *avctx, return AVERROR(ENOMEM); } else { // initialize lut_status buffer to a value never used to compare against -memset(*cf_lut_status, -1, sizeof(*cf_lut_status) * LUT_BUFF); +memset(*cf_lut_status, -1, sizeof(**cf_lut_status) * LUT_BUFF); } return 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '3a6ddfb8745e4b306a5637927fb057f630345e2f'
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Sat Nov 15 01:54:32 2014 +0100| [a5adeff45745ec973bb42217a61752dc80d256c4] | committer: Michael Niedermayer Merge commit '3a6ddfb8745e4b306a5637927fb057f630345e2f' * commit '3a6ddfb8745e4b306a5637927fb057f630345e2f': exr: check return value Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a5adeff45745ec973bb42217a61752dc80d256c4 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] exr: check return value
ffmpeg | branch: master | Vittorio Giovara vittorio.giov...@gmail.com | Wed Nov 12 19:10:45 2014 +0100| [3a6ddfb8745e4b306a5637927fb057f630345e2f] | committer: Vittorio Giovara exr: check return value CC: libav-sta...@libav.org Bug-Id: CID 1198259 http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3a6ddfb8745e4b306a5637927fb057f630345e2f --- libavcodec/exr.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/exr.c b/libavcodec/exr.c index 37a31ce..4aa6eaf 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -311,8 +311,9 @@ static int huf_unpack_enc_table(GetByteContext *gb, int32_t im, int32_t iM, uint64_t *hcode) { GetBitContext gbit; - -init_get_bits8(gbit, gb-buffer, bytestream2_get_bytes_left(gb)); +int ret = init_get_bits8(gbit, gb-buffer, bytestream2_get_bytes_left(gb)); +if (ret 0) +return ret; for (; im = iM; im++) { uint64_t l = hcode[im] = get_bits(gbit, 6); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lpc: always initialize ref and err
ffmpeg | branch: master | Vittorio Giovara vittorio.giov...@gmail.com | Wed Nov 12 19:10:47 2014 +0100| [60e0ee7ca25bd3bea54043b0607efe4cd51acaf3] | committer: Vittorio Giovara lpc: always initialize ref and err CC: libav-sta...@libav.org Bug-Id: CID 29585 / CID 700759 http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=60e0ee7ca25bd3bea54043b0607efe4cd51acaf3 --- libavcodec/lpc.c |2 +- libavcodec/lpc.h |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/lpc.c b/libavcodec/lpc.c index fbd1bdf..1482e57 100644 --- a/libavcodec/lpc.c +++ b/libavcodec/lpc.c @@ -174,7 +174,7 @@ int ff_lpc_calc_coefs(LPCContext *s, int omethod, int max_shift, int zero_shift) { double autoc[MAX_LPC_ORDER+1]; -double ref[MAX_LPC_ORDER]; +double ref[MAX_LPC_ORDER] = { 0 }; double lpc[MAX_LPC_ORDER][MAX_LPC_ORDER]; int i, j, pass = 0; int opt_order; diff --git a/libavcodec/lpc.h b/libavcodec/lpc.h index c41a1f8..6b3f80e 100644 --- a/libavcodec/lpc.h +++ b/libavcodec/lpc.h @@ -152,7 +152,7 @@ static inline int compute_lpc_coefs(const LPC_TYPE *autoc, int max_order, int normalize) { int i, j; -LPC_TYPE err; +LPC_TYPE err = { 0 }; LPC_TYPE *lpc_last = lpc; if (normalize) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '60e0ee7ca25bd3bea54043b0607efe4cd51acaf3'
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Sat Nov 15 02:00:46 2014 +0100| [d4065a9f475589823608218e3b25a0df941495a6] | committer: Michael Niedermayer Merge commit '60e0ee7ca25bd3bea54043b0607efe4cd51acaf3' * commit '60e0ee7ca25bd3bea54043b0607efe4cd51acaf3': lpc: always initialize ref and err The initialization is not needed, its merged anyway as it might help suppressing warnings and might make the code more robust against future changes See: c4a36b6f70f37e668874d134f955eb96e23853c9 See: 0dd99628ea15f1fe7121b8a983c0b1fe57660027 Merged-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d4065a9f475589823608218e3b25a0df941495a6 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/lpc: remove unneeded {}
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Sat Nov 15 02:08:20 2014 +0100| [85929b9caa90553f9e1bbd7a3ead03ef2ade4d71] | committer: Michael Niedermayer avcodec/lpc: remove unneeded {} Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=85929b9caa90553f9e1bbd7a3ead03ef2ade4d71 --- libavcodec/lpc.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/lpc.h b/libavcodec/lpc.h index b36b19e..9e0b056 100644 --- a/libavcodec/lpc.h +++ b/libavcodec/lpc.h @@ -153,7 +153,7 @@ static inline int compute_lpc_coefs(const LPC_TYPE *autoc, int max_order, int normalize) { int i, j; -LPC_TYPE err = { 0 }; +LPC_TYPE err = 0; LPC_TYPE *lpc_last = lpc; av_assert2(normalize || !fail); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] atrac3plus: always initialize refwaves
ffmpeg | branch: master | Vittorio Giovara vittorio.giov...@gmail.com | Wed Nov 12 19:10:46 2014 +0100| [d16ec1b6db25bc348b0d4800c9a0c9b7070e3710] | committer: Vittorio Giovara atrac3plus: always initialize refwaves CC: libav-sta...@libav.org Bug-Id: CID 1163851 http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d16ec1b6db25bc348b0d4800c9a0c9b7070e3710 --- libavcodec/atrac3plus.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/atrac3plus.c b/libavcodec/atrac3plus.c index f337fab..7071596 100644 --- a/libavcodec/atrac3plus.c +++ b/libavcodec/atrac3plus.c @@ -1575,7 +1575,7 @@ static void decode_tones_amplitude(GetBitContext *gb, Atrac3pChanUnitCtx *ctx, { int mode, sb, j, i, diff, maxdiff, fi, delta, pred; Atrac3pWaveParam *wsrc, *wref; -int refwaves[48]; +int refwaves[48] = { 0 }; Atrac3pWavesData *dst = ctx-channels[ch_num].tones_info; Atrac3pWavesData *ref = ctx-channels[0].tones_info; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/tinterlace: split context definition into seperate header so it can be used by future optimizations
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Sat Nov 15 03:09:28 2014 +0100| [9d548fce24057649f0463e1243417d8f80f1d1db] | committer: Michael Niedermayer avfilter/tinterlace: split context definition into seperate header so it can be used by future optimizations Idea from 2e1704059ae8625beda2ffde847ad22c5ba416dc from Kieran Kunhya Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9d548fce24057649f0463e1243417d8f80f1d1db --- libavfilter/tinterlace.h| 56 +++ libavfilter/vf_tinterlace.c | 24 +-- 2 files changed, 57 insertions(+), 23 deletions(-) diff --git a/libavfilter/tinterlace.h b/libavfilter/tinterlace.h new file mode 100644 index 000..8fc95cb --- /dev/null +++ b/libavfilter/tinterlace.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2011 Stefano Sabatini + * Copyright (c) 2010 Baptiste Coudurier + * Copyright (c) 2003 Michael Zucchi not...@ximian.com + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with FFmpeg; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * @file + * temporal field interlace filter, ported from MPlayer/libmpcodecs + */ +#ifndef AVFILTER_TINTERLACE_H +#define AVFILTER_TINTERLACE_H + +#include libavutil/opt.h +#include avfilter.h + +enum TInterlaceMode { +MODE_MERGE = 0, +MODE_DROP_EVEN, +MODE_DROP_ODD, +MODE_PAD, +MODE_INTERLEAVE_TOP, +MODE_INTERLEAVE_BOTTOM, +MODE_INTERLACEX2, +MODE_NB, +}; + +typedef struct { +const AVClass *class; +enum TInterlaceMode mode; /// interlace mode selected +int flags; /// flags affecting interlacing algorithm +int frame; /// number of the output frame +int vsub; /// chroma vertical subsampling +AVFrame *cur; +AVFrame *next; +uint8_t *black_data[4]; /// buffer used to fill padded lines +int black_linesize[4]; +} TInterlaceContext; + +#endif /* AVFILTER_TINTERLACE_H */ diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c index a3cb52d..6ef2a92 100644 --- a/libavfilter/vf_tinterlace.c +++ b/libavfilter/vf_tinterlace.c @@ -30,29 +30,7 @@ #include libavutil/avassert.h #include avfilter.h #include internal.h - -enum TInterlaceMode { -MODE_MERGE = 0, -MODE_DROP_EVEN, -MODE_DROP_ODD, -MODE_PAD, -MODE_INTERLEAVE_TOP, -MODE_INTERLEAVE_BOTTOM, -MODE_INTERLACEX2, -MODE_NB, -}; - -typedef struct { -const AVClass *class; -enum TInterlaceMode mode; /// interlace mode selected -int flags; /// flags affecting interlacing algorithm -int frame; /// number of the output frame -int vsub; /// chroma vertical subsampling -AVFrame *cur; -AVFrame *next; -uint8_t *black_data[4]; /// buffer used to fill padded lines -int black_linesize[4]; -} TInterlaceContext; +#include tinterlace.h #define OFFSET(x) offsetof(TInterlaceContext, x) #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/tinterlace: add Support for ff_lowpass_line_avx() ff_lowpass_line_sse2()
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Sat Nov 15 03:49:37 2014 +0100| [fb3eb573699e3eec76393ca6d5bdf86b7ac5e349] | committer: Michael Niedermayer avfilter/tinterlace: add Support for ff_lowpass_line_avx() ff_lowpass_line_sse2() Based-on: 2e1704059ae8625beda2ffde847ad22c5ba416dc by Kieran Kunhya Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fb3eb573699e3eec76393ca6d5bdf86b7ac5e349 --- libavfilter/tinterlace.h |2 ++ libavfilter/vf_tinterlace.c |2 ++ libavfilter/x86/Makefile |2 ++ libavfilter/x86/vf_tinterlace_init.c | 47 ++ 4 files changed, 53 insertions(+) diff --git a/libavfilter/tinterlace.h b/libavfilter/tinterlace.h index 8d33452..41b78c5 100644 --- a/libavfilter/tinterlace.h +++ b/libavfilter/tinterlace.h @@ -55,4 +55,6 @@ typedef struct { const uint8_t *srcp_above, const uint8_t *srcp_below); } TInterlaceContext; +void ff_tinterlace_init_x86(TInterlaceContext *interlace); + #endif /* AVFILTER_TINTERLACE_H */ diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c index 1d34d21..2a5f3d9 100644 --- a/libavfilter/vf_tinterlace.c +++ b/libavfilter/vf_tinterlace.c @@ -145,6 +145,8 @@ static int config_out_props(AVFilterLink *outlink) if (tinterlace-flags TINTERLACE_FLAG_VLPF) { tinterlace-lowpass_line = lowpass_line_c; +if (ARCH_X86) +ff_tinterlace_init_x86(tinterlace); } av_log(ctx, AV_LOG_VERBOSE, mode:%d filter:%s h:%d - h:%d\n, diff --git a/libavfilter/x86/Makefile b/libavfilter/x86/Makefile index ef2d0e9..44765d2 100644 --- a/libavfilter/x86/Makefile +++ b/libavfilter/x86/Makefile @@ -5,6 +5,7 @@ OBJS-$(CONFIG_INTERLACE_FILTER) += x86/vf_interlace_init.o OBJS-$(CONFIG_NOISE_FILTER) += x86/vf_noise.o OBJS-$(CONFIG_PULLUP_FILTER) += x86/vf_pullup_init.o OBJS-$(CONFIG_SPP_FILTER)+= x86/vf_spp.o +OBJS-$(CONFIG_TINTERLACE_FILTER) += x86/vf_tinterlace_init.o OBJS-$(CONFIG_VOLUME_FILTER) += x86/af_volume_init.o OBJS-$(CONFIG_YADIF_FILTER) += x86/vf_yadif_init.o @@ -13,5 +14,6 @@ YASM-OBJS-$(CONFIG_HQDN3D_FILTER)+= x86/vf_hqdn3d.o YASM-OBJS-$(CONFIG_IDET_FILTER) += x86/vf_idet.o YASM-OBJS-$(CONFIG_INTERLACE_FILTER) += x86/vf_interlace.o YASM-OBJS-$(CONFIG_PULLUP_FILTER)+= x86/vf_pullup.o +YASM-OBJS-$(CONFIG_TINTERLACE_FILTER)+= x86/vf_interlace.o YASM-OBJS-$(CONFIG_VOLUME_FILTER)+= x86/af_volume.o YASM-OBJS-$(CONFIG_YADIF_FILTER) += x86/vf_yadif.o x86/yadif-16.o x86/yadif-10.o diff --git a/libavfilter/x86/vf_tinterlace_init.c b/libavfilter/x86/vf_tinterlace_init.c new file mode 100644 index 000..ddb0cce --- /dev/null +++ b/libavfilter/x86/vf_tinterlace_init.c @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2014 Kieran Kunhya kier...@obe.tv + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with FFmpeg; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include libavutil/attributes.h +#include libavutil/cpu.h +#include libavutil/internal.h +#include libavutil/mem.h +#include libavutil/x86/asm.h +#include libavutil/x86/cpu.h + +#include libavfilter/tinterlace.h + +void ff_lowpass_line_sse2(uint8_t *dstp, ptrdiff_t linesize, + const uint8_t *srcp, + const uint8_t *srcp_above, + const uint8_t *srcp_below); +void ff_lowpass_line_avx (uint8_t *dstp, ptrdiff_t linesize, + const uint8_t *srcp, + const uint8_t *srcp_above, + const uint8_t *srcp_below); + +av_cold void ff_tinterlace_init_x86(TInterlaceContext *s) +{ +int cpu_flags = av_get_cpu_flags(); + +if (EXTERNAL_SSE2(cpu_flags)) +s-lowpass_line = ff_lowpass_line_sse2; +if (EXTERNAL_AVX(cpu_flags)) +s-lowpass_line = ff_lowpass_line_avx; +} ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_tinterlace: fix linesize vs. width
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Wed Nov 12 04:48:24 2014 +0100| [f043965cd5145d8540d55c013b0d809b6a874c53] | committer: Michael Niedermayer avfilter/vf_tinterlace: fix linesize vs. width Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f043965cd5145d8540d55c013b0d809b6a874c53 --- libavfilter/vf_tinterlace.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c index 4ce69da..a3cb52d 100644 --- a/libavfilter/vf_tinterlace.c +++ b/libavfilter/vf_tinterlace.c @@ -187,6 +187,7 @@ void copy_picture_field(uint8_t *dst[4], int dst_linesize[4], for (plane = 0; plane desc-nb_components; plane++) { int lines = plane == 1 || plane == 2 ? FF_CEIL_RSHIFT(src_h, vsub) : src_h; +int cols = plane == 1 || plane == 2 ? FF_CEIL_RSHIFT(w, desc-log2_chroma_w) : w; int linesize = av_image_get_linesize(format, w, plane); uint8_t *dstp = dst[plane]; const uint8_t *srcp = src[plane]; @@ -210,7 +211,7 @@ void copy_picture_field(uint8_t *dst[4], int dst_linesize[4], const uint8_t *srcp_below = srcp + src_linesize[plane]; if (h == lines) srcp_above = srcp; // there is no line above if (h == 1) srcp_below = srcp; // there is no line below -for (i = 0; i linesize; i++) { +for (i = 0; i cols; i++) { // this calculation is an integer representation of // '0.5 * current + 0.25 * above + 0.25 * below' // '1 +' is for rounding. */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/x86/vf_interlace: rewrite asm
ffmpeg | branch: master | Michael Niedermayer michae...@gmx.at | Sat Nov 15 04:07:08 2014 +0100| [05e4b25e9b0a3586033dc21548b03c8e5071efe3] | committer: Michael Niedermayer avfilter/x86/vf_interlace: rewrite asm 4775 decicycles - 3688 decicycles Signed-off-by: Michael Niedermayer michae...@gmx.at http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=05e4b25e9b0a3586033dc21548b03c8e5071efe3 --- libavfilter/x86/vf_interlace.asm | 46 -- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/libavfilter/x86/vf_interlace.asm b/libavfilter/x86/vf_interlace.asm index 55b430d..2d61d7b 100644 --- a/libavfilter/x86/vf_interlace.asm +++ b/libavfilter/x86/vf_interlace.asm @@ -2,6 +2,7 @@ ;* x86-optimized functions for interlace filter ;* ;* Copyright (C) 2014 Kieran Kunhya kier...@obe.tv +;* Copyright (c) 2014 Michael Niedermayer michae...@gmx.at ;* ;* This file is part of FFmpeg. ;* @@ -34,36 +35,27 @@ cglobal lowpass_line, 5, 5, 7 add r4, r1 neg r1 -pxor m6, m6 +pcmpeqb m6, m6 .loop -mova m0, [r2+r1] -punpcklbw m1, m0, m6 -punpckhbw m0, m6 -paddw m0, m0 -paddw m1, m1 +mova m0, [r3+r1] +mova m1, [r3+r1+mmsize] +pavgb m0, [r4+r1] +pavgb m1, [r4+r1+mmsize] +mova m2, [r2+r1] +mova m3, [r2+r1+mmsize] +pxor m0, m6 +pxor m1, m6 +pxor m2, m6 +pxor m3, m6 +pavgb m0, m2 +pavgb m1, m3 +pxor m0, m6 +pxor m1, m6 +mova [r0+r1], m0 +mova [r0+r1+mmsize], m1 -mova m2, [r3+r1] -punpcklbw m3, m2, m6 -punpckhbw m2, m6 - -mova m4, [r4+r1] -punpcklbw m5, m4, m6 -punpckhbw m4, m6 - -paddw m1, m3 -pavgw m1, m5 - -paddw m0, m2 -pavgw m0, m4 - -psrlw m0, 1 -psrlw m1, 1 - -packuswb m1, m0 -mova [r0+r1], m1 - -add r1, mmsize +add r1, 2*mmsize jl .loop REP_RET %endmacro ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog