Overview

Request 2355 (accepted)

update internal ffmpeg to version 2.8.4

Submit package home:enzokiel:...hes:Multimedia / avidemux3 to package Multimedia / avidemux3

avidemux3.changes Changed
x
 
1
@@ -1,4 +1,9 @@
2
 -------------------------------------------------------------------
3
+We Dec 23 13:25:33 UTC 2015 - joerg.lorenzen@ki.tng.de
4
+
5
+- update internal ffmpeg to version 2.8.4
6
+
7
+-------------------------------------------------------------------
8
 Sat Dec 05 12:23:17 UTC 2015 - joerg.lorenzen@ki.tng.de
9
 
10
 - update internal ffmpeg to version 2.8.3
11
avidemux3.spec Changed
10
 
1
@@ -16,7 +16,7 @@
2
 #
3
 
4
 
5
-%define         ffmpeg_version 2.8.3
6
+%define         ffmpeg_version 2.8.4
7
 
8
 Name:           avidemux3
9
 Summary:        Graphical video editing and transcoding tool
10
ffmpeg-2.8.3.tar.bz2/Changelog -> ffmpeg-2.8.4.tar.bz2/Changelog Changed
76
 
1
@@ -1,6 +1,74 @@
2
 Entries are sorted chronologically from oldest to youngest within each release,
3
 releases are sorted from youngest to oldest.
4
 
5
+version 2.8.4
6
+- rawdec: only exempt BIT0 with need_copy from buffer sanity check
7
+- mlvdec: check that index_entries exist
8
+- avcodec/mpeg4videodec: also for empty partitioned slices
9
+- avcodec/h264_refs: Fix long_idx check
10
+- avcodec/h264_mc_template: prefetch list1 only if it is used in the MB
11
+- avcodec/h264_slice: Simplify ref2frm indexing
12
+- avfilter/vf_mpdecimate: Add missing emms_c()
13
+- sonic: make sure num_taps * channels is not larger than frame_size
14
+- opus_silk: fix typo causing overflow in silk_stabilize_lsf
15
+- ffm: reject invalid codec_id and codec_type
16
+- golomb: always check for invalid UE golomb codes in get_ue_golomb
17
+- sbr_qmf_analysis: sanitize input for 32-bit imdct
18
+- sbrdsp_fixed: assert that input values are in the valid range
19
+- aacsbr: ensure strictly monotone time borders
20
+- aacenc: update max_sfb when num_swb changes
21
+- aaccoder: prevent crash of anmr coder
22
+- ffmdec: reject zero-sized chunks
23
+- swscale/x86/rgb2rgb_template: Fallback to mmx in interleaveBytes() if the alignment is insufficient for SSE*
24
+- swscale/x86/rgb2rgb_template: Do not crash on misaligend stride
25
+- avformat/mxfenc: Do not crash if there is no packet in the first stream
26
+- lavf/tee: fix side data double free.
27
+- avformat/hlsenc: Check the return code of avformat_write_header()
28
+- avformat/mov: Enable parser for mp3s by old HandBrake
29
+- avformat/mxfenc: Fix integer overflow in length computation
30
+- avformat/utils: estimate_timings_from_pts - increase retry counter, fixes invalid duration for ts files with hevc codec
31
+- avformat/matroskaenc: Check codecdelay before use
32
+- avutil/mathematics: Fix division by 0
33
+- mjpegdec: consider chroma subsampling in size check
34
+- libvpxenc: remove some unused ctrl id mappings
35
+- avcodec/vp3: ensure header is parsed successfully before tables
36
+- avcodec/jpeg2000dec: Check bpno in decode_cblk()
37
+- avcodec/pgssubdec: Fix left shift of 255 by 24 places cannot be represented in type int
38
+- swscale/utils: Fix for runtime error: left shift of negative value -1
39
+- avcodec/hevc: Fix integer overflow of entry_point_offset
40
+- avcodec/dirac_parser: Check that there is a previous PU before accessing it
41
+- avcodec/dirac_parser: Add basic validity checks for next_pu_offset and prev_pu_offset
42
+- avcodec/dirac_parser: Fix potential overflows in pointer checks
43
+- avcodec/wmaprodec: Check bits per sample to be within the range not causing integer overflows
44
+- avcodec/wmaprodec: Fix overflow of cutoff
45
+- avformat/smacker: fix integer overflow with pts_inc
46
+- avcodec/vp3: Fix "runtime error: left shift of negative value"
47
+- avformat/riffdec: Initialize bitrate
48
+- mpegencts: Fix overflow in cbr mode period calculations
49
+- avutil/timecode: Fix fps check
50
+- avutil/mathematics: return INT64_MIN (=AV_NOPTS_VALUE) from av_rescale_rnd() for overflows
51
+- avcodec/apedec: Check length in long_filter_high_3800()
52
+- avcodec/vp3: always set pix_fmt in theora_decode_header()
53
+- avcodec/mpeg4videodec: Check available data before reading custom matrix
54
+- avutil/mathematics: Do not treat INT64_MIN as positive in av_rescale_rnd
55
+- avutil/integer: Fix av_mod_i() with negative dividend
56
+- avformat/dump: Fix integer overflow in av_dump_format()
57
+- avcodec/h264_refs: Check that long references match before use
58
+- avcodec/utils: Clear dimensions in ff_get_buffer() on failure
59
+- avcodec/utils: Use 64bit for aspect ratio calculation in avcodec_string()
60
+- avcodec/hevc: Check max ctb addresses for WPP
61
+- avcodec/vp3: Clear context on reinitialization failure
62
+- avcodec/hevc: allocate entries unconditionally
63
+- avcodec/hevc_cabac: Fix multiple integer overflows
64
+- avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_encode*()
65
+- avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_decode*()
66
+- avcodec/hevc: Check entry_point_offsets
67
+- lavf/rtpenc_jpeg: Less strict check for standard Huffman tables.
68
+- avcodec/ffv1dec: Clear quant_table_count if its invalid
69
+- avcodec/ffv1dec: Print an error if the quant table count is invalid
70
+- doc/filters/drawtext: fix centering example
71
+
72
+
73
 version 2.8.3
74
 - avcodec/cabac: Check initial cabac decoder state
75
 - avcodec/cabac_functions: Fix "left shift of negative value -31767"
76
ffmpeg-2.8.3.tar.bz2/RELEASE -> ffmpeg-2.8.4.tar.bz2/RELEASE Changed
4
 
1
@@ -1,1 +1,1 @@
2
-2.8.3
3
+2.8.4
4
ffmpeg-2.8.3.tar.bz2/VERSION -> ffmpeg-2.8.4.tar.bz2/VERSION Changed
4
 
1
@@ -1,1 +1,1 @@
2
-2.8.3
3
+2.8.4
4
ffmpeg-2.8.3.tar.bz2/doc/Doxyfile -> ffmpeg-2.8.4.tar.bz2/doc/Doxyfile Changed
10
 
1
@@ -31,7 +31,7 @@
2
 # This could be handy for archiving the generated documentation or
3
 # if some version control system is used.
4
 
5
-PROJECT_NUMBER         = 2.8.3
6
+PROJECT_NUMBER         = 2.8.4
7
 
8
 # With the PROJECT_LOGO tag one can specify a logo or icon that is included
9
 # in the documentation. The maximum height of the logo should not exceed 55
10
ffmpeg-2.8.3.tar.bz2/doc/filters.texi -> ffmpeg-2.8.4.tar.bz2/doc/filters.texi Changed
10
 
1
@@ -4967,7 +4967,7 @@
2
 @item
3
 Show the text at the center of the video frame:
4
 @example
5
-drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h-line_h)/2"
6
+drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2"
7
 @end example
8
 
9
 @item
10
ffmpeg-2.8.3.tar.bz2/libavcodec/aaccoder.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/aaccoder.c Changed
10
 
1
@@ -499,7 +499,7 @@
2
     }
3
     while (idx) {
4
         sce->sf_idx[bandaddr[idx]] = minq + q0;
5
-        minq = paths[idx][minq].prev;
6
+        minq = FFMAX(paths[idx][minq].prev, 0);
7
         idx--;
8
     }
9
     //set the same quantizers inside window groups
10
ffmpeg-2.8.3.tar.bz2/libavcodec/aacenc.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/aacenc.c Changed
9
 
1
@@ -547,6 +547,7 @@
2
             ics->num_windows        = wi[ch].num_windows;
3
             ics->swb_sizes          = s->psy.bands    [ics->num_windows == 8];
4
             ics->num_swb            = tag == TYPE_LFE ? ics->num_swb : s->psy.num_bands[ics->num_windows == 8];
5
+            ics->max_sfb            = FFMIN(ics->max_sfb, ics->num_swb);
6
             ics->swb_offset         = wi[ch].window_type[0] == EIGHT_SHORT_SEQUENCE ?
7
                                         ff_swb_offset_128 [s->samplerate_index]:
8
                                         ff_swb_offset_1024[s->samplerate_index];
9
ffmpeg-2.8.3.tar.bz2/libavcodec/aacsbr_template.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/aacsbr_template.c Changed
44
 
1
@@ -718,8 +718,8 @@
2
     }
3
 
4
     for (i = 1; i <= ch_data->bs_num_env; i++) {
5
-        if (ch_data->t_env[i-1] > ch_data->t_env[i]) {
6
-            av_log(ac->avctx, AV_LOG_ERROR, "Non monotone time borders\n");
7
+        if (ch_data->t_env[i-1] >= ch_data->t_env[i]) {
8
+            av_log(ac->avctx, AV_LOG_ERROR, "Not strictly monotone time borders\n");
9
             return -1;
10
         }
11
     }
12
@@ -1154,6 +1154,9 @@
13
                              INTFLOAT z[320], INTFLOAT W[2][32][32][2], int buf_idx)
14
 {
15
     int i;
16
+#if USE_FIXED
17
+    int j;
18
+#endif
19
     memcpy(x    , x+1024, (320-32)*sizeof(x[0]));
20
     memcpy(x+288, in,         1024*sizeof(x[0]));
21
     for (i = 0; i < 32; i++) { // numTimeSlots*RATE = 16*2 as 960 sample frames
22
@@ -1161,6 +1164,21 @@
23
         dsp->vector_fmul_reverse(z, sbr_qmf_window_ds, x, 320);
24
         sbrdsp->sum64x5(z);
25
         sbrdsp->qmf_pre_shuffle(z);
26
+#if USE_FIXED
27
+        for (j = 64; j < 128; j++) {
28
+            if (z[j] > 1<<24) {
29
+                av_log(NULL, AV_LOG_WARNING,
30
+                       "sbr_qmf_analysis: value %09d too large, setting to %09d\n",
31
+                       z[j], 1<<24);
32
+                z[j] = 1<<24;
33
+            } else if (z[j] < -(1<<24)) {
34
+                av_log(NULL, AV_LOG_WARNING,
35
+                       "sbr_qmf_analysis: value %09d too small, setting to %09d\n",
36
+                       z[j], -(1<<24));
37
+                z[j] = -(1<<24);
38
+            }
39
+        }
40
+#endif
41
         mdct->imdct_half(mdct, z, z+64);
42
         sbrdsp->qmf_post_shuffle(W[buf_idx][i], z);
43
         x += 32;
44
ffmpeg-2.8.3.tar.bz2/libavcodec/apedec.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/apedec.c Changed
11
 
1
@@ -892,6 +892,9 @@
2
     int32_t dotprod, sign;
3
     int32_t coeffs[256], delay[256];
4
 
5
+    if (order >= length)
6
+        return;
7
+
8
     memset(coeffs, 0, order * sizeof(*coeffs));
9
     for (i = 0; i < order; i++)
10
         delay[i] = buffer[i];
11
ffmpeg-2.8.3.tar.bz2/libavcodec/dirac_parser.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/dirac_parser.c Changed
42
 
1
@@ -100,10 +100,12 @@
2
 static int unpack_parse_unit(DiracParseUnit *pu, DiracParseContext *pc,
3
                              int offset)
4
 {
5
-    uint8_t *start = pc->buffer + offset;
6
-    uint8_t *end   = pc->buffer + pc->index;
7
-    if (start < pc->buffer || (start + 13 > end))
8
+    int8_t *start;
9
+
10
+    if (offset < 0 || pc->index - 13 < offset)
11
         return 0;
12
+
13
+    start = pc->buffer + offset;
14
     pu->pu_type = start[4];
15
 
16
     pu->next_pu_offset = AV_RB32(start + 5);
17
@@ -112,6 +114,15 @@
18
     if (pu->pu_type == 0x10 && pu->next_pu_offset == 0)
19
         pu->next_pu_offset = 13;
20
 
21
+    if (pu->next_pu_offset && pu->next_pu_offset < 13) {
22
+        av_log(NULL, AV_LOG_ERROR, "next_pu_offset %d is invalid\n", pu->next_pu_offset);
23
+        return 0;
24
+    }
25
+    if (pu->prev_pu_offset && pu->prev_pu_offset < 13) {
26
+        av_log(NULL, AV_LOG_ERROR, "prev_pu_offset %d is invalid\n", pu->prev_pu_offset);
27
+        return 0;
28
+    }
29
+
30
     return 1;
31
 }
32
 
33
@@ -190,7 +201,7 @@
34
         }
35
 
36
         /* Get the picture number to set the pts and dts*/
37
-        if (parse_timing_info) {
38
+        if (parse_timing_info && pu1.prev_pu_offset >= 13) {
39
             uint8_t *cur_pu = pc->buffer +
40
                               pc->index - 13 - pu1.prev_pu_offset;
41
             int pts = AV_RB32(cur_pu + 13);
42
ffmpeg-2.8.3.tar.bz2/libavcodec/ffv1dec.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/ffv1dec.c Changed
14
 
1
@@ -569,8 +569,11 @@
2
     }
3
 
4
     f->quant_table_count = get_symbol(c, state, 0);
5
-    if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES || !f->quant_table_count)
6
+    if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES || !f->quant_table_count) {
7
+        av_log(f->avctx, AV_LOG_ERROR, "quant table count %d is invalid\n", f->quant_table_count);
8
+        f->quant_table_count = 0;
9
         return AVERROR_INVALIDDATA;
10
+    }
11
 
12
     for (i = 0; i < f->quant_table_count; i++) {
13
         f->context_count[i] = read_quant_tables(c, f->quant_tables[i]);
14
ffmpeg-2.8.3.tar.bz2/libavcodec/golomb.h -> ffmpeg-2.8.4.tar.bz2/libavcodec/golomb.h Changed
10
 
1
@@ -68,7 +68,7 @@
2
         int log = 2 * av_log2(buf) - 31;
3
         LAST_SKIP_BITS(re, gb, 32 - log);
4
         CLOSE_READER(re, gb);
5
-        if (CONFIG_FTRAPV && log < 0) {
6
+        if (log < 7) {
7
             av_log(NULL, AV_LOG_ERROR, "Invalid UE golomb code\n");
8
             return AVERROR_INVALIDDATA;
9
         }
10
ffmpeg-2.8.3.tar.bz2/libavcodec/h264_mc_template.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/h264_mc_template.c Changed
10
 
1
@@ -158,6 +158,7 @@
2
         }
3
     }
4
 
5
-    prefetch_motion(h, sl, 1, PIXEL_SHIFT, CHROMA_IDC);
6
+    if (USES_LIST(mb_type, 1))
7
+        prefetch_motion(h, sl, 1, PIXEL_SHIFT, CHROMA_IDC);
8
 }
9
 
10
ffmpeg-2.8.3.tar.bz2/libavcodec/h264_refs.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/h264_refs.c Changed
45
 
1
@@ -122,6 +122,14 @@
2
     return out_i;
3
 }
4
 
5
+static int mismatches_ref(H264Context *h, H264Picture *pic)
6
+{
7
+    AVFrame *f = pic->f;
8
+    return (h->cur_pic_ptr->f->width  != f->width ||
9
+            h->cur_pic_ptr->f->height != f->height ||
10
+            h->cur_pic_ptr->f->format != f->format);
11
+}
12
+
13
 int ff_h264_fill_default_ref_list(H264Context *h, H264SliceContext *sl)
14
 {
15
     int i, len;
16
@@ -193,10 +201,7 @@
17
     for (j = 0; j<1+(sl->slice_type_nos == AV_PICTURE_TYPE_B); j++) {
18
         for (i = 0; i < sl->ref_count[j]; i++) {
19
             if (h->default_ref_list[j][i].parent) {
20
-                AVFrame *f = h->default_ref_list[j][i].parent->f;
21
-                if (h->cur_pic_ptr->f->width  != f->width ||
22
-                    h->cur_pic_ptr->f->height != f->height ||
23
-                    h->cur_pic_ptr->f->format != f->format) {
24
+                if (mismatches_ref(h, h->default_ref_list[j][i].parent)) {
25
                     av_log(h->avctx, AV_LOG_ERROR, "Discarding mismatching reference\n");
26
                     memset(&h->default_ref_list[j][i], 0, sizeof(h->default_ref_list[j][i]));
27
                 }
28
@@ -298,14 +303,14 @@
29
 
30
                     long_idx = pic_num_extract(h, pic_id, &pic_structure);
31
 
32
-                    if (long_idx > 31) {
33
+                    if (long_idx > 31U) {
34
                         av_log(h->avctx, AV_LOG_ERROR,
35
                                "long_term_pic_idx overflow\n");
36
                         return AVERROR_INVALIDDATA;
37
                     }
38
                     ref = h->long_ref[long_idx];
39
                     assert(!(ref && !ref->reference));
40
-                    if (ref && (ref->reference & pic_structure)) {
41
+                    if (ref && (ref->reference & pic_structure) && !mismatches_ref(h, ref)) {
42
                         ref->pic_id = pic_id;
43
                         assert(ref->long_ref);
44
                         i = 0;
45
ffmpeg-2.8.3.tar.bz2/libavcodec/h264_slice.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/h264_slice.c Changed
49
 
1
@@ -1993,12 +1993,12 @@
2
         if (USES_LIST(top_type, list)) {
3
             const int b_xy  = h->mb2b_xy[top_xy] + 3 * b_stride;
4
             const int b8_xy = 4 * top_xy + 2;
5
-            int (*ref2frm)[64] = (void*)(sl->ref2frm[h->slice_table[top_xy] & (MAX_SLICES - 1)][0] + (MB_MBAFF(sl) ? 20 : 2));
6
+            int *ref2frm = sl->ref2frm[h->slice_table[top_xy] & (MAX_SLICES - 1)][list] + (MB_MBAFF(sl) ? 20 : 2);
7
             AV_COPY128(mv_dst - 1 * 8, h->cur_pic.motion_val[list][b_xy + 0]);
8
             ref_cache[0 - 1 * 8] =
9
-            ref_cache[1 - 1 * 8] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 0]];
10
+            ref_cache[1 - 1 * 8] = ref2frm[h->cur_pic.ref_index[list][b8_xy + 0]];
11
             ref_cache[2 - 1 * 8] =
12
-            ref_cache[3 - 1 * 8] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 1]];
13
+            ref_cache[3 - 1 * 8] = ref2frm[h->cur_pic.ref_index[list][b8_xy + 1]];
14
         } else {
15
             AV_ZERO128(mv_dst - 1 * 8);
16
             AV_WN32A(&ref_cache[0 - 1 * 8], ((LIST_NOT_USED) & 0xFF) * 0x01010101u);
17
@@ -2008,15 +2008,15 @@
18
             if (USES_LIST(left_type[LTOP], list)) {
19
                 const int b_xy  = h->mb2b_xy[left_xy[LTOP]] + 3;
20
                 const int b8_xy = 4 * left_xy[LTOP] + 1;
21
-                int (*ref2frm)[64] =(void*)( sl->ref2frm[h->slice_table[left_xy[LTOP]] & (MAX_SLICES - 1)][0] + (MB_MBAFF(sl) ? 20 : 2));
22
+                int *ref2frm = sl->ref2frm[h->slice_table[left_xy[LTOP]] & (MAX_SLICES - 1)][list] + (MB_MBAFF(sl) ? 20 : 2);
23
                 AV_COPY32(mv_dst - 1 +  0, h->cur_pic.motion_val[list][b_xy + b_stride * 0]);
24
                 AV_COPY32(mv_dst - 1 +  8, h->cur_pic.motion_val[list][b_xy + b_stride * 1]);
25
                 AV_COPY32(mv_dst - 1 + 16, h->cur_pic.motion_val[list][b_xy + b_stride * 2]);
26
                 AV_COPY32(mv_dst - 1 + 24, h->cur_pic.motion_val[list][b_xy + b_stride * 3]);
27
                 ref_cache[-1 +  0] =
28
-                ref_cache[-1 +  8] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 2 * 0]];
29
+                ref_cache[-1 +  8] = ref2frm[h->cur_pic.ref_index[list][b8_xy + 2 * 0]];
30
                 ref_cache[-1 + 16] =
31
-                ref_cache[-1 + 24] = ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 2 * 1]];
32
+                ref_cache[-1 + 24] = ref2frm[h->cur_pic.ref_index[list][b8_xy + 2 * 1]];
33
             } else {
34
                 AV_ZERO32(mv_dst - 1 +  0);
35
                 AV_ZERO32(mv_dst - 1 +  8);
36
@@ -2041,9 +2041,9 @@
37
 
38
     {
39
         int8_t *ref = &h->cur_pic.ref_index[list][4 * mb_xy];
40
-        int (*ref2frm)[64] = (void*)(sl->ref2frm[sl->slice_num & (MAX_SLICES - 1)][0] + (MB_MBAFF(sl) ? 20 : 2));
41
-        uint32_t ref01 = (pack16to32(ref2frm[list][ref[0]], ref2frm[list][ref[1]]) & 0x00FF00FF) * 0x0101;
42
-        uint32_t ref23 = (pack16to32(ref2frm[list][ref[2]], ref2frm[list][ref[3]]) & 0x00FF00FF) * 0x0101;
43
+        int *ref2frm = sl->ref2frm[sl->slice_num & (MAX_SLICES - 1)][list] + (MB_MBAFF(sl) ? 20 : 2);
44
+        uint32_t ref01 = (pack16to32(ref2frm[ref[0]], ref2frm[ref[1]]) & 0x00FF00FF) * 0x0101;
45
+        uint32_t ref23 = (pack16to32(ref2frm[ref[2]], ref2frm[ref[3]]) & 0x00FF00FF) * 0x0101;
46
         AV_WN32A(&ref_cache[0 * 8], ref01);
47
         AV_WN32A(&ref_cache[1 * 8], ref01);
48
         AV_WN32A(&ref_cache[2 * 8], ref23);
49
ffmpeg-2.8.3.tar.bz2/libavcodec/hevc.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/hevc.c Changed
63
 
1
@@ -744,7 +744,7 @@
2
             av_freep(&sh->entry_point_offset);
3
             av_freep(&sh->offset);
4
             av_freep(&sh->size);
5
-            sh->entry_point_offset = av_malloc_array(sh->num_entry_point_offsets, sizeof(int));
6
+            sh->entry_point_offset = av_malloc_array(sh->num_entry_point_offsets, sizeof(unsigned));
7
             sh->offset = av_malloc_array(sh->num_entry_point_offsets, sizeof(int));
8
             sh->size = av_malloc_array(sh->num_entry_point_offsets, sizeof(int));
9
             if (!sh->entry_point_offset || !sh->offset || !sh->size) {
10
@@ -2440,8 +2440,8 @@
11
     HEVCLocalContext *lc = s->HEVClc;
12
     int *ret = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
13
     int *arg = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
14
-    int offset;
15
-    int startheader, cmpt = 0;
16
+    int64_t offset;
17
+    int64_t startheader, cmpt = 0;
18
     int i, j, res = 0;
19
 
20
     if (!ret || !arg) {
21
@@ -2450,11 +2450,18 @@
22
         return AVERROR(ENOMEM);
23
     }
24
 
25
+    if (s->sh.slice_ctb_addr_rs + s->sh.num_entry_point_offsets * s->ps.sps->ctb_width >= s->ps.sps->ctb_width * s->ps.sps->ctb_height) {
26
+        av_log(s->avctx, AV_LOG_ERROR, "WPP ctb addresses are wrong (%d %d %d %d)\n",
27
+            s->sh.slice_ctb_addr_rs, s->sh.num_entry_point_offsets,
28
+            s->ps.sps->ctb_width, s->ps.sps->ctb_height
29
+        );
30
+        res = AVERROR_INVALIDDATA;
31
+        goto error;
32
+    }
33
 
34
-    if (!s->sList[1]) {
35
-        ff_alloc_entries(s->avctx, s->sh.num_entry_point_offsets + 1);
36
-
37
+    ff_alloc_entries(s->avctx, s->sh.num_entry_point_offsets + 1);
38
 
39
+    if (!s->sList[1]) {
40
         for (i = 1; i < s->threads_number; i++) {
41
             s->sList[i] = av_malloc(sizeof(HEVCContext));
42
             memcpy(s->sList[i], s, sizeof(HEVCContext));
43
@@ -2487,6 +2494,11 @@
44
     }
45
     if (s->sh.num_entry_point_offsets != 0) {
46
         offset += s->sh.entry_point_offset[s->sh.num_entry_point_offsets - 1] - cmpt;
47
+        if (length < offset) {
48
+            av_log(s->avctx, AV_LOG_ERROR, "entry_point_offset table is corrupted\n");
49
+            res = AVERROR_INVALIDDATA;
50
+            goto error;
51
+        }
52
         s->sh.size[s->sh.num_entry_point_offsets - 1] = length - offset;
53
         s->sh.offset[s->sh.num_entry_point_offsets - 1] = offset;
54
 
55
@@ -2513,6 +2525,7 @@
56
 
57
     for (i = 0; i <= s->sh.num_entry_point_offsets; i++)
58
         res += ret[i];
59
+error:
60
     av_free(ret);
61
     av_free(arg);
62
     return res;
63
ffmpeg-2.8.3.tar.bz2/libavcodec/hevc.h -> ffmpeg-2.8.4.tar.bz2/libavcodec/hevc.h Changed
10
 
1
@@ -622,7 +622,7 @@
2
 
3
     unsigned int max_num_merge_cand; ///< 5 - 5_minus_max_num_merge_cand
4
 
5
-    int *entry_point_offset;
6
+    unsigned *entry_point_offset;
7
     int * offset;
8
     int * size;
9
     int num_entry_point_offsets;
10
ffmpeg-2.8.3.tar.bz2/libavcodec/hevc_cabac.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/hevc_cabac.c Changed
29
 
1
@@ -831,11 +831,13 @@
2
     int k = 1;
3
 
4
     while (k < CABAC_MAX_BIN && get_cabac_bypass(&s->HEVClc->cc)) {
5
-        ret += 1 << k;
6
+        ret += 1U << k;
7
         k++;
8
     }
9
-    if (k == CABAC_MAX_BIN)
10
+    if (k == CABAC_MAX_BIN) {
11
         av_log(s->avctx, AV_LOG_ERROR, "CABAC_MAX_BIN : %d\n", k);
12
+        return 0;
13
+    }
14
     while (k--)
15
         ret += get_cabac_bypass(&s->HEVClc->cc) << k;
16
     return get_cabac_bypass_sign(&s->HEVClc->cc, -ret);
17
@@ -973,8 +975,10 @@
18
 
19
     while (prefix < CABAC_MAX_BIN && get_cabac_bypass(&s->HEVClc->cc))
20
         prefix++;
21
-    if (prefix == CABAC_MAX_BIN)
22
+    if (prefix == CABAC_MAX_BIN) {
23
         av_log(s->avctx, AV_LOG_ERROR, "CABAC_MAX_BIN : %d\n", prefix);
24
+        return 0;
25
+    }
26
     if (prefix < 3) {
27
         for (i = 0; i < rc_rice_param; i++)
28
             suffix = (suffix << 1) | get_cabac_bypass(&s->HEVClc->cc);
29
ffmpeg-2.8.3.tar.bz2/libavcodec/jpeg2000dec.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/jpeg2000dec.c Changed
12
 
1
@@ -1489,6 +1489,10 @@
2
     ff_mqc_initdec(&t1->mqc, cblk->data, 0, 1);
3
 
4
     while (passno--) {
5
+        if (bpno < 0) {
6
+            av_log(s->avctx, AV_LOG_ERROR, "bpno became negative\n");
7
+            return AVERROR_INVALIDDATA;
8
+        }
9
         switch(pass_t) {
10
         case 0:
11
             decode_sigpass(t1, width, height, bpno + 1, bandpos,
12
ffmpeg-2.8.3.tar.bz2/libavcodec/jpeg2000dwt.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/jpeg2000dwt.c Changed
21
 
1
@@ -580,6 +580,9 @@
2
 
3
 int ff_dwt_encode(DWTContext *s, void *t)
4
 {
5
+    if (s->ndeclevels == 0)
6
+        return 0;
7
+
8
     switch(s->type){
9
         case FF_DWT97:
10
             dwt_encode97_float(s, t); break;
11
@@ -595,6 +598,9 @@
12
 
13
 int ff_dwt_decode(DWTContext *s, void *t)
14
 {
15
+    if (s->ndeclevels == 0)
16
+        return 0;
17
+
18
     switch (s->type) {
19
     case FF_DWT97:
20
         dwt_decode97_float(s, t);
21
ffmpeg-2.8.3.tar.bz2/libavcodec/libvpxenc.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/libvpxenc.c Changed
21
 
1
@@ -104,19 +104,11 @@
2
 
3
 /** String mappings for enum vp8e_enc_control_id */
4
 static const char *const ctlidstr[] = {
5
-    [VP8E_UPD_ENTROPY]           = "VP8E_UPD_ENTROPY",
6
-    [VP8E_UPD_REFERENCE]         = "VP8E_UPD_REFERENCE",
7
-    [VP8E_USE_REFERENCE]         = "VP8E_USE_REFERENCE",
8
-    [VP8E_SET_ROI_MAP]           = "VP8E_SET_ROI_MAP",
9
-    [VP8E_SET_ACTIVEMAP]         = "VP8E_SET_ACTIVEMAP",
10
-    [VP8E_SET_SCALEMODE]         = "VP8E_SET_SCALEMODE",
11
     [VP8E_SET_CPUUSED]           = "VP8E_SET_CPUUSED",
12
     [VP8E_SET_ENABLEAUTOALTREF]  = "VP8E_SET_ENABLEAUTOALTREF",
13
     [VP8E_SET_NOISE_SENSITIVITY] = "VP8E_SET_NOISE_SENSITIVITY",
14
-    [VP8E_SET_SHARPNESS]         = "VP8E_SET_SHARPNESS",
15
     [VP8E_SET_STATIC_THRESHOLD]  = "VP8E_SET_STATIC_THRESHOLD",
16
     [VP8E_SET_TOKEN_PARTITIONS]  = "VP8E_SET_TOKEN_PARTITIONS",
17
-    [VP8E_GET_LAST_QUANTIZER]    = "VP8E_GET_LAST_QUANTIZER",
18
     [VP8E_SET_ARNR_MAXFRAMES]    = "VP8E_SET_ARNR_MAXFRAMES",
19
     [VP8E_SET_ARNR_STRENGTH]     = "VP8E_SET_ARNR_STRENGTH",
20
     [VP8E_SET_ARNR_TYPE]         = "VP8E_SET_ARNR_TYPE",
21
ffmpeg-2.8.3.tar.bz2/libavcodec/mjpegdec.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/mjpegdec.c Changed
33
 
1
@@ -1246,7 +1246,7 @@
2
                              int mb_bitmask_size,
3
                              const AVFrame *reference)
4
 {
5
-    int i, mb_x, mb_y;
6
+    int i, mb_x, mb_y, chroma_h_shift, chroma_v_shift, chroma_width, chroma_height;
7
     uint8_t *data[MAX_COMPONENTS];
8
     const uint8_t *reference_data[MAX_COMPONENTS];
9
     int linesize[MAX_COMPONENTS];
10
@@ -1263,6 +1263,11 @@
11
 
12
     s->restart_count = 0;
13
 
14
+    av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &chroma_h_shift,
15
+                                     &chroma_v_shift);
16
+    chroma_width  = FF_CEIL_RSHIFT(s->width,  chroma_h_shift);
17
+    chroma_height = FF_CEIL_RSHIFT(s->height, chroma_v_shift);
18
+
19
     for (i = 0; i < nb_components; i++) {
20
         int c   = s->comp_index[i];
21
         data[c] = s->picture_ptr->data[c];
22
@@ -1299,8 +1304,8 @@
23
 
24
                     if (s->interlaced && s->bottom_field)
25
                         block_offset += linesize[c] >> 1;
26
-                    if (   8*(h * mb_x + x) < s->width
27
-                        && 8*(v * mb_y + y) < s->height) {
28
+                    if (   8*(h * mb_x + x) < ((c == 1) || (c == 2) ? chroma_width  : s->width)
29
+                        && 8*(v * mb_y + y) < ((c == 1) || (c == 2) ? chroma_height : s->height)) {
30
                         ptr = data[c] + block_offset;
31
                     } else
32
                         ptr = NULL;
33
ffmpeg-2.8.3.tar.bz2/libavcodec/mpeg4videodec.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/mpeg4videodec.c Changed
32
 
1
@@ -883,7 +883,7 @@
2
     const int part_a_end   = s->pict_type == AV_PICTURE_TYPE_I ? (ER_DC_END   | ER_MV_END)   : ER_MV_END;
3
 
4
     mb_num = mpeg4_decode_partition_a(ctx);
5
-    if (mb_num < 0) {
6
+    if (mb_num <= 0) {
7
         ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y,
8
                         s->mb_x, s->mb_y, part_a_error);
9
         return -1;
10
@@ -1881,6 +1881,10 @@
11
                 int last = 0;
12
                 for (i = 0; i < 64; i++) {
13
                     int j;
14
+                    if (get_bits_left(gb) < 8) {
15
+                        av_log(s->avctx, AV_LOG_ERROR, "insufficient data for custom matrix\n");
16
+                        return AVERROR_INVALIDDATA;
17
+                    }
18
                     v = get_bits(gb, 8);
19
                     if (v == 0)
20
                         break;
21
@@ -1904,6 +1908,10 @@
22
                 int last = 0;
23
                 for (i = 0; i < 64; i++) {
24
                     int j;
25
+                    if (get_bits_left(gb) < 8) {
26
+                        av_log(s->avctx, AV_LOG_ERROR, "insufficient data for custom matrix\n");
27
+                        return AVERROR_INVALIDDATA;
28
+                    }
29
                     v = get_bits(gb, 8);
30
                     if (v == 0)
31
                         break;
32
ffmpeg-2.8.3.tar.bz2/libavcodec/opus_silk.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/opus_silk.c Changed
10
 
1
@@ -824,7 +824,7 @@
2
 
3
             /* upper extent */
4
             for (i = order; i > k; i--)
5
-                max_center -= min_delta[k];
6
+                max_center -= min_delta[i];
7
             max_center -= min_delta[k] >> 1;
8
 
9
             /* move apart */
10
ffmpeg-2.8.3.tar.bz2/libavcodec/pgssubdec.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/pgssubdec.c Changed
10
 
1
@@ -33,7 +33,7 @@
2
 #include "libavutil/imgutils.h"
3
 #include "libavutil/opt.h"
4
 
5
-#define RGBA(r,g,b,a) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
6
+#define RGBA(r,g,b,a) (((unsigned)(a) << 24) | ((r) << 16) | ((g) << 8) | (b))
7
 #define MAX_EPOCH_PALETTES 8   // Max 8 allowed per PGS epoch
8
 #define MAX_EPOCH_OBJECTS  64  // Max 64 allowed per PGS epoch
9
 #define MAX_OBJECT_REFS    2   // Max objects per display set
10
ffmpeg-2.8.3.tar.bz2/libavcodec/rawdec.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/rawdec.c Changed
10
 
1
@@ -258,7 +258,7 @@
2
         buf += buf_size - context->frame_size;
3
 
4
     len = context->frame_size - (avctx->pix_fmt==AV_PIX_FMT_PAL8 ? AVPALETTE_SIZE : 0);
5
-    if (buf_size < len && (avctx->codec_tag & 0xFFFFFF) != MKTAG('B','I','T', 0)) {
6
+    if (buf_size < len && ((avctx->codec_tag & 0xFFFFFF) != MKTAG('B','I','T', 0) || !need_copy)) {
7
         av_log(avctx, AV_LOG_ERROR, "Invalid buffer size, packet size %d < expected frame_size %d\n", buf_size, len);
8
         av_buffer_unref(&frame->buf[0]);
9
         return AVERROR(EINVAL);
10
ffmpeg-2.8.3.tar.bz2/libavcodec/sbrdsp_fixed.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/sbrdsp_fixed.c Changed
16
 
1
@@ -38,9 +38,14 @@
2
     int i, nz, round;
3
 
4
     for (i = 0; i < n; i += 2) {
5
+        // Larger values are inavlid and could cause overflows of accu.
6
+        av_assert2(FFABS(x[i + 0][0]) >> 29 == 0);
7
         accu += (int64_t)x[i + 0][0] * x[i + 0][0];
8
+        av_assert2(FFABS(x[i + 0][1]) >> 29 == 0);
9
         accu += (int64_t)x[i + 0][1] * x[i + 0][1];
10
+        av_assert2(FFABS(x[i + 1][0]) >> 29 == 0);
11
         accu += (int64_t)x[i + 1][0] * x[i + 1][0];
12
+        av_assert2(FFABS(x[i + 1][1]) >> 29 == 0);
13
         accu += (int64_t)x[i + 1][1] * x[i + 1][1];
14
     }
15
 
16
ffmpeg-2.8.3.tar.bz2/libavcodec/sonic.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/sonic.c Changed
15
 
1
@@ -928,6 +928,13 @@
2
     s->frame_size = s->channels*s->block_align*s->downsampling;
3
 //    avctx->frame_size = s->block_align;
4
 
5
+    if (s->num_taps * s->channels > s->frame_size) {
6
+        av_log(avctx, AV_LOG_ERROR,
7
+               "number of taps times channels (%d * %d) larger than frame size %d\n",
8
+               s->num_taps, s->channels, s->frame_size);
9
+        return AVERROR_INVALIDDATA;
10
+    }
11
+
12
     av_log(avctx, AV_LOG_INFO, "Sonic: ver: %d.%d ls: %d dr: %d taps: %d block: %d frame: %d downsamp: %d\n",
13
         s->version, s->minor_version, s->lossless, s->decorrelation, s->num_taps, s->block_align, s->frame_size, s->downsampling);
14
 
15
ffmpeg-2.8.3.tar.bz2/libavcodec/utils.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/utils.c Changed
24
 
1
@@ -1040,8 +1040,10 @@
2
 int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
3
 {
4
     int ret = get_buffer_internal(avctx, frame, flags);
5
-    if (ret < 0)
6
+    if (ret < 0) {
7
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
8
+        frame->width = frame->height = 0;
9
+    }
10
     return ret;
11
 }
12
 
13
@@ -3178,8 +3180,8 @@
14
 
15
             if (enc->sample_aspect_ratio.num) {
16
                 av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
17
-                          enc->width * enc->sample_aspect_ratio.num,
18
-                          enc->height * enc->sample_aspect_ratio.den,
19
+                          enc->width * (int64_t)enc->sample_aspect_ratio.num,
20
+                          enc->height * (int64_t)enc->sample_aspect_ratio.den,
21
                           1024 * 1024);
22
                 snprintf(buf + strlen(buf), buf_size - strlen(buf),
23
                          " [SAR %d:%d DAR %d:%d]",
24
ffmpeg-2.8.3.tar.bz2/libavcodec/vp3.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/vp3.c Changed
81
 
1
@@ -131,7 +131,7 @@
2
 
3
 typedef struct Vp3DecodeContext {
4
     AVCodecContext *avctx;
5
-    int theora, theora_tables;
6
+    int theora, theora_tables, theora_header;
7
     int version;
8
     int width, height;
9
     int chroma_x_shift, chroma_y_shift;
10
@@ -209,8 +209,8 @@
11
     int16_t *dct_tokens[3][64];
12
     int16_t *dct_tokens_base;
13
 #define TOKEN_EOB(eob_run)              ((eob_run) << 2)
14
-#define TOKEN_ZERO_RUN(coeff, zero_run) (((coeff) << 9) + ((zero_run) << 2) + 1)
15
-#define TOKEN_COEFF(coeff)              (((coeff) << 2) + 2)
16
+#define TOKEN_ZERO_RUN(coeff, zero_run) (((coeff) * 512) + ((zero_run) << 2) + 1)
17
+#define TOKEN_COEFF(coeff)              (((coeff) * 4) + 2)
18
 
19
     /**
20
      * number of blocks that contain DCT coefficients at
21
@@ -2016,17 +2016,19 @@
22
             vp3_decode_end(avctx);
23
             ret = theora_decode_header(avctx, &gb);
24
 
25
+            if (ret >= 0)
26
+                ret = vp3_decode_init(avctx);
27
             if (ret < 0) {
28
                 vp3_decode_end(avctx);
29
-            } else
30
-                ret = vp3_decode_init(avctx);
31
+            }
32
             return ret;
33
         } else if (type == 2) {
34
             ret = theora_decode_tables(avctx, &gb);
35
+            if (ret >= 0)
36
+                ret = vp3_decode_init(avctx);
37
             if (ret < 0) {
38
                 vp3_decode_end(avctx);
39
-            } else
40
-                ret = vp3_decode_init(avctx);
41
+            }
42
             return ret;
43
         }
44
 
45
@@ -2251,6 +2253,7 @@
46
     int ret;
47
     AVRational fps, aspect;
48
 
49
+    s->theora_header = 0;
50
     s->theora = get_bits_long(gb, 24);
51
     av_log(avctx, AV_LOG_DEBUG, "Theora bitstream version %X\n", s->theora);
52
 
53
@@ -2321,7 +2324,8 @@
54
             return AVERROR_INVALIDDATA;
55
         }
56
         skip_bits(gb, 3); /* reserved */
57
-    }
58
+    } else
59
+        avctx->pix_fmt = AV_PIX_FMT_YUV420P;
60
 
61
     ret = ff_set_dimensions(avctx, s->width, s->height);
62
     if (ret < 0)
63
@@ -2355,6 +2359,7 @@
64
         avctx->color_trc  = AVCOL_TRC_BT709;
65
     }
66
 
67
+    s->theora_header = 1;
68
     return 0;
69
 }
70
 
71
@@ -2363,6 +2368,9 @@
72
     Vp3DecodeContext *s = avctx->priv_data;
73
     int i, n, matrices, inter, plane;
74
 
75
+    if (!s->theora_header)
76
+        return AVERROR_INVALIDDATA;
77
+
78
     if (s->theora >= 0x030200) {
79
         n = get_bits(gb, 3);
80
         /* loop filter limit values table */
81
ffmpeg-2.8.3.tar.bz2/libavcodec/wmaprodec.c -> ffmpeg-2.8.4.tar.bz2/libavcodec/wmaprodec.c Changed
23
 
1
@@ -300,6 +300,12 @@
2
         s->decode_flags    = AV_RL16(edata_ptr+14);
3
         channel_mask       = AV_RL32(edata_ptr+2);
4
         s->bits_per_sample = AV_RL16(edata_ptr);
5
+
6
+        if (s->bits_per_sample > 32 || s->bits_per_sample < 1) {
7
+            avpriv_request_sample(avctx, "bits per sample is %d", s->bits_per_sample);
8
+            return AVERROR_PATCHWELCOME;
9
+        }
10
+
11
         /** dump the extradata */
12
         for (i = 0; i < avctx->extradata_size; i++)
13
             ff_dlog(avctx, "[%x] ", avctx->extradata[i]);
14
@@ -477,7 +483,7 @@
15
     /** calculate subwoofer cutoff values */
16
     for (i = 0; i < num_possible_block_sizes; i++) {
17
         int block_size = s->samples_per_frame >> i;
18
-        int cutoff = (440*block_size + 3 * (s->avctx->sample_rate >> 1) - 1)
19
+        int cutoff = (440*block_size + 3LL * (s->avctx->sample_rate >> 1) - 1)
20
                      / s->avctx->sample_rate;
21
         s->subwoofer_cutoffs[i] = av_clip(cutoff, 4, block_size);
22
     }
23
ffmpeg-2.8.3.tar.bz2/libavfilter/vf_mpdecimate.c -> ffmpeg-2.8.4.tar.bz2/libavfilter/vf_mpdecimate.c Changed
16
 
1
@@ -131,10 +131,13 @@
2
                         cur->data[plane], cur->linesize[plane],
3
                         ref->data[plane], ref->linesize[plane],
4
                         FF_CEIL_RSHIFT(ref->width,  hsub),
5
-                        FF_CEIL_RSHIFT(ref->height, vsub)))
6
+                        FF_CEIL_RSHIFT(ref->height, vsub))) {
7
+            emms_c();
8
             return 0;
9
+        }
10
     }
11
 
12
+    emms_c();
13
     return 1;
14
 }
15
 
16
ffmpeg-2.8.3.tar.bz2/libavformat/dump.c -> ffmpeg-2.8.4.tar.bz2/libavformat/dump.c Changed
10
 
1
@@ -496,7 +496,7 @@
2
         av_log(NULL, AV_LOG_INFO, "  Duration: ");
3
         if (ic->duration != AV_NOPTS_VALUE) {
4
             int hours, mins, secs, us;
5
-            int64_t duration = ic->duration + 5000;
6
+            int64_t duration = ic->duration + (ic->duration <= INT64_MAX - 5000 ? 5000 : 0);
7
             secs  = duration / AV_TIME_BASE;
8
             us    = duration % AV_TIME_BASE;
9
             mins  = secs / 60;
10
ffmpeg-2.8.3.tar.bz2/libavformat/ffmdec.c -> ffmpeg-2.8.4.tar.bz2/libavformat/ffmdec.c Changed
77
 
1
@@ -268,6 +268,7 @@
2
     AVStream *st;
3
     AVIOContext *pb = s->pb;
4
     AVCodecContext *codec;
5
+    const AVCodecDescriptor *codec_desc;
6
     int ret;
7
     int f_main = 0, f_cprv = -1, f_stvi = -1, f_stau = -1;
8
     AVCodec *enc;
9
@@ -322,7 +323,20 @@
10
             codec = st->codec;
11
             /* generic info */
12
             codec->codec_id = avio_rb32(pb);
13
+            codec_desc = avcodec_descriptor_get(codec->codec_id);
14
+            if (!codec_desc) {
15
+                av_log(s, AV_LOG_ERROR, "Invalid codec id: %d\n", codec->codec_id);
16
+                codec->codec_id = AV_CODEC_ID_NONE;
17
+                goto fail;
18
+            }
19
             codec->codec_type = avio_r8(pb);
20
+            if (codec->codec_type != codec_desc->type) {
21
+                av_log(s, AV_LOG_ERROR, "Codec type mismatch: expected %d, found %d\n",
22
+                       codec_desc->type, codec->codec_type);
23
+                codec->codec_id = AV_CODEC_ID_NONE;
24
+                codec->codec_type = AVMEDIA_TYPE_UNKNOWN;
25
+                goto fail;
26
+            }
27
             codec->bit_rate = avio_rb32(pb);
28
             codec->flags = avio_rb32(pb);
29
             codec->flags2 = avio_rb32(pb);
30
@@ -415,7 +429,7 @@
31
             }
32
             break;
33
         case MKBETAG('S', '2', 'V', 'I'):
34
-            if (f_stvi++) {
35
+            if (f_stvi++ || !size) {
36
                 ret = AVERROR(EINVAL);
37
                 goto fail;
38
             }
39
@@ -430,7 +444,7 @@
40
                 goto fail;
41
             break;
42
         case MKBETAG('S', '2', 'A', 'U'):
43
-            if (f_stau++) {
44
+            if (f_stau++ || !size) {
45
                 ret = AVERROR(EINVAL);
46
                 goto fail;
47
             }
48
@@ -471,6 +485,7 @@
49
     AVStream *st;
50
     AVIOContext *pb = s->pb;
51
     AVCodecContext *codec;
52
+    const AVCodecDescriptor *codec_desc;
53
     int i, nb_streams;
54
     uint32_t tag;
55
 
56
@@ -508,7 +523,20 @@
57
         codec = st->codec;
58
         /* generic info */
59
         codec->codec_id = avio_rb32(pb);
60
+        codec_desc = avcodec_descriptor_get(codec->codec_id);
61
+        if (!codec_desc) {
62
+            av_log(s, AV_LOG_ERROR, "Invalid codec id: %d\n", codec->codec_id);
63
+            codec->codec_id = AV_CODEC_ID_NONE;
64
+            goto fail;
65
+        }
66
         codec->codec_type = avio_r8(pb); /* codec_type */
67
+        if (codec->codec_type != codec_desc->type) {
68
+            av_log(s, AV_LOG_ERROR, "Codec type mismatch: expected %d, found %d\n",
69
+                   codec_desc->type, codec->codec_type);
70
+            codec->codec_id = AV_CODEC_ID_NONE;
71
+            codec->codec_type = AVMEDIA_TYPE_UNKNOWN;
72
+            goto fail;
73
+        }
74
         codec->bit_rate = avio_rb32(pb);
75
         codec->flags = avio_rb32(pb);
76
         codec->flags2 = avio_rb32(pb);
77
ffmpeg-2.8.3.tar.bz2/libavformat/hlsenc.c -> ffmpeg-2.8.4.tar.bz2/libavformat/hlsenc.c Changed
15
 
1
@@ -548,8 +548,11 @@
2
     if (oc->oformat->priv_class && oc->priv_data)
3
         av_opt_set(oc->priv_data, "mpegts_flags", "resend_headers", 0);
4
 
5
-    if (c->vtt_basename)
6
-        avformat_write_header(vtt_oc,NULL);
7
+    if (c->vtt_basename) {
8
+        err = avformat_write_header(vtt_oc,NULL);
9
+        if (err < 0)
10
+            return err;
11
+    }
12
 
13
     return 0;
14
 }
15
ffmpeg-2.8.3.tar.bz2/libavformat/isom.h -> ffmpeg-2.8.4.tar.bz2/libavformat/isom.h Changed
9
 
1
@@ -184,6 +184,7 @@
2
     MOVTrackExt *trex_data;
3
     unsigned trex_count;
4
     int itunes_metadata;  ///< metadata are itunes style
5
+    int handbrake_version;
6
     int chapter_track;
7
     int use_absolute_path;
8
     int ignore_editlist;
9
ffmpeg-2.8.3.tar.bz2/libavformat/matroskaenc.c -> ffmpeg-2.8.4.tar.bz2/libavformat/matroskaenc.c Changed
24
 
1
@@ -926,14 +926,18 @@
2
     }
3
 
4
     if (codec->codec_type == AVMEDIA_TYPE_AUDIO && codec->initial_padding && codec->codec_id == AV_CODEC_ID_OPUS) {
5
+        int64_t codecdelay = av_rescale_q(codec->initial_padding,
6
+                                          (AVRational){ 1, codec->sample_rate },
7
+                                          (AVRational){ 1, 1000000000 });
8
+        if (codecdelay < 0) {
9
+            av_log(s, AV_LOG_ERROR, "Initial padding is invalid\n");
10
+            return AVERROR(EINVAL);
11
+        }
12
 //         mkv->tracks[i].ts_offset = av_rescale_q(codec->initial_padding,
13
 //                                                 (AVRational){ 1, codec->sample_rate },
14
 //                                                 st->time_base);
15
 
16
-        put_ebml_uint(pb, MATROSKA_ID_CODECDELAY,
17
-                      av_rescale_q(codec->initial_padding,
18
-                                   (AVRational){ 1, codec->sample_rate },
19
-                                   (AVRational){ 1, 1000000000 }));
20
+        put_ebml_uint(pb, MATROSKA_ID_CODECDELAY, codecdelay);
21
     }
22
     if (codec->codec_id == AV_CODEC_ID_OPUS) {
23
         put_ebml_uint(pb, MATROSKA_ID_SEEKPREROLL, OPUS_SEEK_PREROLL);
24
ffmpeg-2.8.3.tar.bz2/libavformat/mlvdec.c -> ffmpeg-2.8.4.tar.bz2/libavformat/mlvdec.c Changed
13
 
1
@@ -365,6 +365,11 @@
2
     if (ast)
3
         ast->duration = ast->nb_index_entries;
4
 
5
+    if ((vst && !vst->nb_index_entries) || (ast && !ast->nb_index_entries)) {
6
+        av_log(avctx, AV_LOG_ERROR, "no index entries found\n");
7
+        return AVERROR_INVALIDDATA;
8
+    }
9
+
10
     if (vst && ast)
11
         avio_seek(pb, FFMIN(vst->index_entries[0].pos, ast->index_entries[0].pos), SEEK_SET);
12
     else if (vst)
13
ffmpeg-2.8.3.tar.bz2/libavformat/mov.c -> ffmpeg-2.8.4.tar.bz2/libavformat/mov.c Changed
28
 
1
@@ -419,6 +419,12 @@
2
             snprintf(key2, sizeof(key2), "%s-%s", key, language);
3
             av_dict_set(&c->fc->metadata, key2, str, 0);
4
         }
5
+        if (!strcmp(key, "encoder")) {
6
+            int major, minor, micro;
7
+            if (sscanf(str, "HandBrake %d.%d.%d", &major, &minor, &micro) == 3) {
8
+                c->handbrake_version = 1000000*major + 1000*minor + micro;
9
+            }
10
+        }
11
     }
12
     av_log(c->fc, AV_LOG_TRACE, "lang \"%3s\" ", language);
13
     av_log(c->fc, AV_LOG_TRACE, "tag \"%s\" value \"%s\" atom \"%.4s\" %d %"PRId64"\n",
14
@@ -4528,6 +4534,13 @@
15
                     return err;
16
             }
17
         }
18
+        if (mov->handbrake_version &&
19
+            mov->handbrake_version <= 1000000*0 + 1000*10 + 0 &&  // 0.10.0
20
+            st->codec->codec_id == AV_CODEC_ID_MP3
21
+        ) {
22
+            av_log(s, AV_LOG_VERBOSE, "Forcing full parsing for mp3 stream\n");
23
+            st->need_parsing = AVSTREAM_PARSE_FULL;
24
+        }
25
     }
26
 
27
     if (mov->trex_data) {
28
ffmpeg-2.8.3.tar.bz2/libavformat/mpegtsenc.c -> ffmpeg-2.8.4.tar.bz2/libavformat/mpegtsenc.c Changed
16
 
1
@@ -756,11 +756,11 @@
2
         ts_st = pcr_st->priv_data;
3
 
4
     if (ts->mux_rate > 1) {
5
-        service->pcr_packet_period = (ts->mux_rate * ts->pcr_period) /
6
+        service->pcr_packet_period = (int64_t)ts->mux_rate * ts->pcr_period /
7
                                      (TS_PACKET_SIZE * 8 * 1000);
8
-        ts->sdt_packet_period      = (ts->mux_rate * SDT_RETRANS_TIME) /
9
+        ts->sdt_packet_period      = (int64_t)ts->mux_rate * SDT_RETRANS_TIME /
10
                                      (TS_PACKET_SIZE * 8 * 1000);
11
-        ts->pat_packet_period      = (ts->mux_rate * PAT_RETRANS_TIME) /
12
+        ts->pat_packet_period      = (int64_t)ts->mux_rate * PAT_RETRANS_TIME /
13
                                      (TS_PACKET_SIZE * 8 * 1000);
14
 
15
         if (ts->copyts < 1)
16
ffmpeg-2.8.3.tar.bz2/libavformat/mxfenc.c -> ffmpeg-2.8.4.tar.bz2/libavformat/mxfenc.c Changed
26
 
1
@@ -1266,11 +1266,11 @@
2
             user_comment_count = mxf_write_user_comments(s, s->metadata);
3
         mxf_write_metadata_key(pb, 0x013600);
4
         PRINT_KEY(s, "Material Package key", pb->buf_ptr - 16);
5
-        klv_encode_ber_length(pb, 92 + name_size + (16*track_count) + (16*user_comment_count) + 12*mxf->store_user_comments);
6
+        klv_encode_ber_length(pb, 92 + name_size + (16*track_count) + (16*user_comment_count) + 12LL*mxf->store_user_comments);
7
     } else {
8
         mxf_write_metadata_key(pb, 0x013700);
9
         PRINT_KEY(s, "Source Package key", pb->buf_ptr - 16);
10
-        klv_encode_ber_length(pb, 112 + name_size + (16*track_count) + 12*mxf->store_user_comments); // 20 bytes length for descriptor reference
11
+        klv_encode_ber_length(pb, 112 + name_size + (16*track_count) + 12LL*mxf->store_user_comments); // 20 bytes length for descriptor reference
12
     }
13
 
14
     // write uid
15
@@ -2467,6 +2467,10 @@
16
         }
17
         mxf->edit_units_count++;
18
     } else if (!mxf->edit_unit_byte_count && st->index == 1) {
19
+        if (!mxf->edit_units_count) {
20
+            av_log(s, AV_LOG_ERROR, "No packets in first stream\n");
21
+            return AVERROR_PATCHWELCOME;
22
+        }
23
         mxf->index_entries[mxf->edit_units_count-1].slice_offset =
24
             mxf->body_offset - mxf->index_entries[mxf->edit_units_count-1].offset;
25
     }
26
ffmpeg-2.8.3.tar.bz2/libavformat/riffdec.c -> ffmpeg-2.8.4.tar.bz2/libavformat/riffdec.c Changed
10
 
1
@@ -87,7 +87,7 @@
2
                       AVCodecContext *codec, int size, int big_endian)
3
 {
4
     int id;
5
-    uint64_t bitrate;
6
+    uint64_t bitrate = 0;
7
 
8
     if (size < 14) {
9
         avpriv_request_sample(codec, "wav header size < 14");
10
ffmpeg-2.8.3.tar.bz2/libavformat/rtpenc_jpeg.c -> ffmpeg-2.8.4.tar.bz2/libavformat/rtpenc_jpeg.c Changed
105
 
1
@@ -36,6 +36,7 @@
2
     int off = 0; /* fragment offset of the current JPEG frame */
3
     int len;
4
     int i;
5
+    int default_huffman_tables = 0;
6
 
7
     s->buf_ptr   = s->buf;
8
     s->timestamp = s->cur_timestamp;
9
@@ -90,23 +91,66 @@
10
                 return;
11
             }
12
         } else if (buf[i + 1] == DHT) {
13
-            if (   AV_RB16(&buf[i + 2]) < 418
14
-                || i + 420 >= size
15
-                || buf[i +   4] != 0x00
16
-                || buf[i +  33] != 0x01
17
-                || buf[i +  62] != 0x10
18
-                || buf[i + 241] != 0x11
19
-                || memcmp(buf + i +   5, avpriv_mjpeg_bits_dc_luminance   + 1, 16)
20
-                || memcmp(buf + i +  21, avpriv_mjpeg_val_dc, 12)
21
-                || memcmp(buf + i +  34, avpriv_mjpeg_bits_dc_chrominance + 1, 16)
22
-                || memcmp(buf + i +  50, avpriv_mjpeg_val_dc, 12)
23
-                || memcmp(buf + i +  63, avpriv_mjpeg_bits_ac_luminance   + 1, 16)
24
-                || memcmp(buf + i +  79, avpriv_mjpeg_val_ac_luminance, 162)
25
-                || memcmp(buf + i + 242, avpriv_mjpeg_bits_ac_chrominance + 1, 16)
26
-                || memcmp(buf + i + 258, avpriv_mjpeg_val_ac_chrominance, 162)) {
27
-                av_log(s1, AV_LOG_ERROR,
28
-                       "RFC 2435 requires standard Huffman tables for jpeg\n");
29
-                return;
30
+            int dht_size = AV_RB16(&buf[i + 2]);
31
+            default_huffman_tables |= 1 << 4;
32
+            i += 3;
33
+            dht_size -= 2;
34
+            if (i + dht_size >= size)
35
+                continue;
36
+            while (dht_size > 0)
37
+                switch (buf[i + 1]) {
38
+                case 0x00:
39
+                    if (   dht_size >= 29
40
+                        && !memcmp(buf + i +  2, avpriv_mjpeg_bits_dc_luminance + 1, 16)
41
+                        && !memcmp(buf + i + 18, avpriv_mjpeg_val_dc, 12)) {
42
+                        default_huffman_tables |= 1;
43
+                        i += 29;
44
+                        dht_size -= 29;
45
+                    } else {
46
+                        i += dht_size;
47
+                        dht_size = 0;
48
+                    }
49
+                    break;
50
+                case 0x01:
51
+                    if (   dht_size >= 29
52
+                        && !memcmp(buf + i +  2, avpriv_mjpeg_bits_dc_chrominance + 1, 16)
53
+                        && !memcmp(buf + i + 18, avpriv_mjpeg_val_dc, 12)) {
54
+                        default_huffman_tables |= 1 << 1;
55
+                        i += 29;
56
+                        dht_size -= 29;
57
+                    } else {
58
+                        i += dht_size;
59
+                        dht_size = 0;
60
+                    }
61
+                    break;
62
+                case 0x10:
63
+                    if (   dht_size >= 179
64
+                        && !memcmp(buf + i +  2, avpriv_mjpeg_bits_ac_luminance   + 1, 16)
65
+                        && !memcmp(buf + i + 18, avpriv_mjpeg_val_ac_luminance, 162)) {
66
+                        default_huffman_tables |= 1 << 2;
67
+                        i += 179;
68
+                        dht_size -= 179;
69
+                    } else {
70
+                        i += dht_size;
71
+                        dht_size = 0;
72
+                    }
73
+                    break;
74
+                case 0x11:
75
+                    if (   dht_size >= 179
76
+                        && !memcmp(buf + i +  2, avpriv_mjpeg_bits_ac_chrominance + 1, 16)
77
+                        && !memcmp(buf + i + 18, avpriv_mjpeg_val_ac_chrominance, 162)) {
78
+                        default_huffman_tables |= 1 << 3;
79
+                        i += 179;
80
+                        dht_size -= 179;
81
+                    } else {
82
+                        i += dht_size;
83
+                        dht_size = 0;
84
+                    }
85
+                    break;
86
+                default:
87
+                    i += dht_size;
88
+                    dht_size = 0;
89
+                    continue;
90
             }
91
         } else if (buf[i + 1] == SOS) {
92
             /* SOS is last marker in the header */
93
@@ -119,6 +163,11 @@
94
             break;
95
         }
96
     }
97
+    if (default_huffman_tables && default_huffman_tables != 31) {
98
+        av_log(s1, AV_LOG_ERROR,
99
+               "RFC 2435 requires standard Huffman tables for jpeg\n");
100
+        return;
101
+    }
102
     if (nb_qtables && nb_qtables != 2)
103
         av_log(s1, AV_LOG_WARNING,
104
                "RFC 2435 suggests two quantization tables, %d provided\n",
105
ffmpeg-2.8.3.tar.bz2/libavformat/smacker.c -> ffmpeg-2.8.4.tar.bz2/libavformat/smacker.c Changed
13
 
1
@@ -120,6 +120,11 @@
2
     smk->height = avio_rl32(pb);
3
     smk->frames = avio_rl32(pb);
4
     smk->pts_inc = (int32_t)avio_rl32(pb);
5
+    if (smk->pts_inc > INT_MAX / 100) {
6
+        av_log(s, AV_LOG_ERROR, "pts_inc %d is too large\n", smk->pts_inc);
7
+        return AVERROR_INVALIDDATA;
8
+    }
9
+
10
     smk->flags = avio_rl32(pb);
11
     if(smk->flags & SMACKER_FLAG_RING_FRAME)
12
         smk->frames++;
13
ffmpeg-2.8.3.tar.bz2/libavformat/tee.c -> ffmpeg-2.8.4.tar.bz2/libavformat/tee.c Changed
10
 
1
@@ -409,6 +409,8 @@
2
         }
3
 
4
         if (ret > 0) {
5
+            pkt->side_data = NULL;
6
+            pkt->side_data_elems = 0;
7
             av_free_packet(pkt);
8
             new_pkt.buf = av_buffer_create(new_pkt.data, new_pkt.size,
9
                                            av_buffer_default_free, NULL, 0);
10
ffmpeg-2.8.3.tar.bz2/libavformat/utils.c -> ffmpeg-2.8.4.tar.bz2/libavformat/utils.c Changed
10
 
1
@@ -2451,7 +2451,7 @@
2
 }
3
 
4
 #define DURATION_MAX_READ_SIZE 250000LL
5
-#define DURATION_MAX_RETRY 4
6
+#define DURATION_MAX_RETRY 6
7
 
8
 /* only usable for MPEG-PS streams */
9
 static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)
10
ffmpeg-2.8.3.tar.bz2/libavutil/integer.c -> ffmpeg-2.8.4.tar.bz2/libavutil/integer.c Changed
23
 
1
@@ -29,6 +29,8 @@
2
 #include "integer.h"
3
 #include "avassert.h"
4
 
5
+static const AVInteger zero_i;
6
+
7
 AVInteger av_add_i(AVInteger a, AVInteger b){
8
     int i, carry=0;
9
 
10
@@ -111,6 +113,12 @@
11
     AVInteger quot_temp;
12
     if(!quot) quot = &quot_temp;
13
 
14
+    if ((int16_t)a.v[AV_INTEGER_SIZE-1] < 0) {
15
+        a = av_mod_i(quot, av_sub_i(zero_i, a), b);
16
+        *quot = av_sub_i(zero_i, *quot);
17
+        return av_sub_i(zero_i, a);
18
+    }
19
+
20
     av_assert2((int16_t)a.v[AV_INTEGER_SIZE-1] >= 0 && (int16_t)b.v[AV_INTEGER_SIZE-1] >= 0);
21
     av_assert2(av_log2_i(b)>=0);
22
 
23
ffmpeg-2.8.3.tar.bz2/libavutil/mathematics.c -> ffmpeg-2.8.4.tar.bz2/libavutil/mathematics.c Changed
37
 
1
@@ -76,8 +76,8 @@
2
         rnd -= AV_ROUND_PASS_MINMAX;
3
     }
4
 
5
-    if (a < 0 && a != INT64_MIN)
6
-        return -av_rescale_rnd(-a, b, c, rnd ^ ((rnd >> 1) & 1));
7
+    if (a < 0)
8
+        return -(uint64_t)av_rescale_rnd(-FFMAX(a, -INT64_MAX), b, c, rnd ^ ((rnd >> 1) & 1));
9
 
10
     if (rnd == AV_ROUND_NEAR_INF)
11
         r = c / 2;
12
@@ -87,8 +87,13 @@
13
     if (b <= INT_MAX && c <= INT_MAX) {
14
         if (a <= INT_MAX)
15
             return (a * b + r) / c;
16
-        else
17
-            return a / c * b + (a % c * b + r) / c;
18
+        else {
19
+            int64_t ad = a / c;
20
+            int64_t a2 = (a % c * b + r) / c;
21
+            if (ad >= INT32_MAX && b && ad > (INT64_MAX - a2) / b)
22
+                return INT64_MIN;
23
+            return ad * b + a2;
24
+        }
25
     } else {
26
 #if 1
27
         uint64_t a0  = a & 0xFFFFFFFF;
28
@@ -112,6 +117,8 @@
29
                 t1++;
30
             }
31
         }
32
+        if (t1 > INT64_MAX)
33
+            return INT64_MIN;
34
         return t1;
35
     }
36
 #else
37
ffmpeg-2.8.3.tar.bz2/libavutil/timecode.c -> ffmpeg-2.8.4.tar.bz2/libavutil/timecode.c Changed
10
 
1
@@ -151,7 +151,7 @@
2
 
3
 static int check_timecode(void *log_ctx, AVTimecode *tc)
4
 {
5
-    if (tc->fps <= 0) {
6
+    if ((int)tc->fps <= 0) {
7
         av_log(log_ctx, AV_LOG_ERROR, "Timecode frame rate must be specified\n");
8
         return AVERROR(EINVAL);
9
     }
10
ffmpeg-2.8.3.tar.bz2/libswscale/utils.c -> ffmpeg-2.8.4.tar.bz2/libswscale/utils.c Changed
10
 
1
@@ -385,7 +385,7 @@
2
 
3
         xDstInSrc = ((dstPos*(int64_t)xInc)>>7) - ((srcPos*0x10000LL)>>7);
4
         for (i = 0; i < dstW; i++) {
5
-            int xx = (xDstInSrc - ((int64_t)(filterSize - 2) << 16)) / (1 << 17);
6
+            int xx = (xDstInSrc - (filterSize - 2) * (1LL<<16)) / (1 << 17);
7
             int j;
8
             (*filterPos)[i] = xx;
9
             for (j = 0; j < filterSize; j++) {
10
ffmpeg-2.8.3.tar.bz2/libswscale/x86/rgb2rgb_template.c -> ffmpeg-2.8.4.tar.bz2/libswscale/x86/rgb2rgb_template.c Changed
42
 
1
@@ -1887,8 +1887,9 @@
2
     for (h=0; h < height; h++) {
3
         int w;
4
 
5
-        if (width >= 16)
6
+        if (width >= 16) {
7
 #if COMPILE_TEMPLATE_SSE2
8
+            if (!((((intptr_t)src1) | ((intptr_t)src2) | ((intptr_t)dest))&15)) {
9
         __asm__(
10
             "xor              %%"REG_a", %%"REG_a"  \n\t"
11
             "1:                                     \n\t"
12
@@ -1907,7 +1908,8 @@
13
             ::"r"(dest), "r"(src1), "r"(src2), "r" ((x86_reg)width-15)
14
             : "memory", XMM_CLOBBERS("xmm0", "xmm1", "xmm2",) "%"REG_a
15
         );
16
-#else
17
+            } else
18
+#endif
19
         __asm__(
20
             "xor %%"REG_a", %%"REG_a"               \n\t"
21
             "1:                                     \n\t"
22
@@ -1933,7 +1935,8 @@
23
             ::"r"(dest), "r"(src1), "r"(src2), "r" ((x86_reg)width-15)
24
             : "memory", "%"REG_a
25
         );
26
-#endif
27
+
28
+        }
29
         for (w= (width&(~15)); w < width; w++) {
30
             dest[2*w+0] = src1[w];
31
             dest[2*w+1] = src2[w];
32
@@ -1943,9 +1946,7 @@
33
         src2 += src2Stride;
34
     }
35
     __asm__(
36
-#if !COMPILE_TEMPLATE_SSE2
37
             EMMS"       \n\t"
38
-#endif
39
             SFENCE"     \n\t"
40
             ::: "memory"
41
             );
42
Refresh

No build results available

Refresh

No rpmlint results available

Request History
enzokiel's avatar

enzokiel created request over 9 years ago

update internal ffmpeg to version 2.8.4


enzokiel's avatar

enzokiel accepted request over 9 years ago

Please add a comment