Overview

Request 1663 (accepted)

- update internal ffmpeg to version 1.2.12

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

avidemux3.changes Changed
x
 
1
@@ -1,4 +1,8 @@
2
 -------------------------------------------------------------------
3
+Thu Feb 26 2015 - joerg.lorenzen@ki.tng.de
4
+- update internal ffmpeg to version 1.2.12
5
+
6
+-------------------------------------------------------------------
7
 Tue Dec 23 2014 - joerg.lorenzen@ki.tng.de
8
 - update internal ffmpeg to version 1.2.11
9
 - removed workaround for build on arm armv6l/armv6hl, the problem
10
avidemux3.spec Changed
19
 
1
@@ -1,7 +1,7 @@
2
 #
3
 # spec file for package avidemux3
4
 #
5
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
6
+# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
7
 #
8
 # All modifications and additions to the file contributed by third parties
9
 # remain the property of their copyright owners, unless otherwise agreed
10
@@ -16,7 +16,7 @@
11
 #
12
 
13
 
14
-%define         ffmpeg_version 1.2.11
15
+%define         ffmpeg_version 1.2.12
16
 
17
 Name:           avidemux3
18
 Summary:        Graphical video editing and transcoding tool
19
ffmpeg-1.2.11.tar.bz2/RELEASE -> ffmpeg-1.2.12.tar.bz2/RELEASE Changed
4
 
1
@@ -1,1 +1,1 @@
2
-1.2.11
3
+1.2.12
4
ffmpeg-1.2.11.tar.bz2/VERSION -> ffmpeg-1.2.12.tar.bz2/VERSION Changed
4
 
1
@@ -1,1 +1,1 @@
2
-1.2.11
3
+1.2.12
4
ffmpeg-1.2.11.tar.bz2/cmdutils.c -> ffmpeg-1.2.12.tar.bz2/cmdutils.c Changed
10
 
1
@@ -65,7 +65,7 @@
2
 AVDictionary *swr_opts;
3
 AVDictionary *format_opts, *codec_opts, *resample_opts;
4
 
5
-const int this_year = 2014;
6
+const int this_year = 2015;
7
 
8
 static FILE *report_file;
9
 
10
ffmpeg-1.2.11.tar.bz2/doc/Doxyfile -> ffmpeg-1.2.12.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         = 1.2.11
6
+PROJECT_NUMBER         = 1.2.12
7
 
8
 # With the PROJECT_LOGO tag one can specify an logo or icon that is included
9
 # in the documentation. The maximum height of the logo should not exceed 55
10
ffmpeg-1.2.11.tar.bz2/ffmpeg.c -> ffmpeg-1.2.12.tar.bz2/ffmpeg.c Changed
10
 
1
@@ -2092,7 +2092,7 @@
2
     AVCodecContext *codec;
3
     OutputStream *ost;
4
     InputStream *ist;
5
-    char error[1024];
6
+    char error[1024] = {0};
7
     int want_sdp = 1;
8
 
9
     /* init framerate emulation */
10
ffmpeg-1.2.11.tar.bz2/libavcodec/dvdsubdec.c -> ffmpeg-1.2.12.tar.bz2/libavcodec/dvdsubdec.c Changed
31
 
1
@@ -99,6 +99,12 @@
2
     int x, y, len, color;
3
     uint8_t *d;
4
 
5
+    if (start >= buf_size)
6
+        return -1;
7
+
8
+    if (w <= 0 || h <= 0)
9
+        return -1;
10
+
11
     bit_len = (buf_size - start) * 8;
12
     init_get_bits(&gb, buf + start, bit_len);
13
 
14
@@ -340,10 +346,12 @@
15
                 sub_header->rects[0] = av_mallocz(sizeof(AVSubtitleRect));
16
                 sub_header->num_rects = 1;
17
                 sub_header->rects[0]->pict.data[0] = bitmap;
18
-                decode_rle(bitmap, w * 2, w, (h + 1) / 2,
19
-                           buf, offset1, buf_size, is_8bit);
20
-                decode_rle(bitmap + w, w * 2, w, h / 2,
21
-                           buf, offset2, buf_size, is_8bit);
22
+                if (decode_rle(bitmap, w * 2, w, (h + 1) / 2,
23
+                               buf, offset1, buf_size, is_8bit) < 0)
24
+                    goto fail;
25
+                if (decode_rle(bitmap + w, w * 2, w, h / 2,
26
+                               buf, offset2, buf_size, is_8bit) < 0)
27
+                    goto fail;
28
                 sub_header->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
29
                 if (is_8bit) {
30
                     if (yuv_palette == 0)
31
ffmpeg-1.2.11.tar.bz2/libavcodec/flac_parser.c -> ffmpeg-1.2.12.tar.bz2/libavcodec/flac_parser.c Changed
10
 
1
@@ -655,7 +655,7 @@
2
 handle_error:
3
     *poutbuf      = NULL;
4
     *poutbuf_size = 0;
5
-    return read_end - buf;
6
+    return buf_size ? read_end - buf : 0;
7
 }
8
 
9
 static int flac_parse_init(AVCodecParserContext *c)
10
ffmpeg-1.2.11.tar.bz2/libavcodec/h264.c -> ffmpeg-1.2.12.tar.bz2/libavcodec/h264.c Changed
128
 
1
@@ -3147,6 +3147,9 @@
2
     int last_pic_structure, last_pic_droppable;
3
     int must_reinit;
4
     int needs_reinit = 0;
5
+    int first_slice = h == h0 && !h0->current_slice;
6
+    int frame_num, picture_structure, droppable;
7
+    PPS *pps;
8
 
9
     h->me.qpel_put = h->h264qpel.put_h264_qpel_pixels_tab;
10
     h->me.qpel_avg = h->h264qpel.avg_h264_qpel_pixels_tab;
11
@@ -3200,17 +3203,26 @@
12
                pps_id);
13
         return -1;
14
     }
15
-    h->pps = *h0->pps_buffers[pps_id];
16
 
17
-    if (!h0->sps_buffers[h->pps.sps_id]) {
18
+    pps = h0->pps_buffers[pps_id];
19
+
20
+    if (!h0->sps_buffers[pps->sps_id]) {
21
         av_log(h->avctx, AV_LOG_ERROR,
22
                "non-existing SPS %u referenced\n",
23
                h->pps.sps_id);
24
         return -1;
25
     }
26
+    if (first_slice)
27
+        h->pps = *h0->pps_buffers[pps_id];
28
+
29
+    if (pps->sps_id != h->current_sps_id ||
30
+        h0->sps_buffers[pps->sps_id]->new) {
31
 
32
-    if (h->pps.sps_id != h->current_sps_id ||
33
-        h0->sps_buffers[h->pps.sps_id]->new) {
34
+        if (!first_slice) {
35
+            av_log(h->avctx, AV_LOG_ERROR,
36
+               "SPS changed in the middle of the frame\n");
37
+            return AVERROR_INVALIDDATA;
38
+        }
39
         h0->sps_buffers[h->pps.sps_id]->new = 0;
40
 
41
         h->current_sps_id = h->pps.sps_id;
42
@@ -3242,13 +3254,15 @@
43
                      || 16*h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag) != h->avctx->coded_height
44
                      || h->avctx->bits_per_raw_sample != h->sps.bit_depth_luma
45
                      || h->cur_chroma_format_idc != h->sps.chroma_format_idc
46
-                     || av_cmp_q(h->sps.sar, h->avctx->sample_aspect_ratio)
47
                      || h->mb_width  != h->sps.mb_width
48
                      || h->mb_height != h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag)
49
                     ));
50
     if (non_j_pixfmt(h0->avctx->pix_fmt) != non_j_pixfmt(get_pixel_format(h0, 0)))
51
         must_reinit = 1;
52
 
53
+    if (first_slice && av_cmp_q(h->sps.sar, h->avctx->sample_aspect_ratio))
54
+        must_reinit = 1;
55
+
56
     h->mb_width  = h->sps.mb_width;
57
     h->mb_height = h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag);
58
     h->mb_num    = h->mb_width * h->mb_height;
59
@@ -3322,37 +3336,40 @@
60
         init_dequant_tables(h);
61
     }
62
 
63
-    h->frame_num = get_bits(&h->gb, h->sps.log2_max_frame_num);
64
+    frame_num = get_bits(&h->gb, h->sps.log2_max_frame_num);
65
+    if (!first_slice) {
66
+        if (h0->frame_num != frame_num) {
67
+            av_log(h->avctx, AV_LOG_ERROR, "Frame num change from %d to %d\n",
68
+                   h0->frame_num, frame_num);
69
+            return AVERROR_INVALIDDATA;
70
+        }
71
+    }
72
 
73
     h->mb_mbaff        = 0;
74
     h->mb_aff_frame    = 0;
75
     last_pic_structure = h0->picture_structure;
76
     last_pic_droppable = h0->droppable;
77
-    h->droppable       = h->nal_ref_idc == 0;
78
+    droppable          = h->nal_ref_idc == 0;
79
     if (h->sps.frame_mbs_only_flag) {
80
-        h->picture_structure = PICT_FRAME;
81
+        picture_structure = PICT_FRAME;
82
     } else {
83
         if (!h->sps.direct_8x8_inference_flag && slice_type == AV_PICTURE_TYPE_B) {
84
             av_log(h->avctx, AV_LOG_ERROR, "This stream was generated by a broken encoder, invalid 8x8 inference\n");
85
             return -1;
86
         }
87
         if (get_bits1(&h->gb)) { // field_pic_flag
88
-            h->picture_structure = PICT_TOP_FIELD + get_bits1(&h->gb); // bottom_field_flag
89
+            picture_structure = PICT_TOP_FIELD + get_bits1(&h->gb); // bottom_field_flag
90
         } else {
91
-            h->picture_structure = PICT_FRAME;
92
+            picture_structure = PICT_FRAME;
93
             h->mb_aff_frame      = h->sps.mb_aff;
94
         }
95
     }
96
-    h->mb_field_decoding_flag = h->picture_structure != PICT_FRAME;
97
-
98
-    if (h0->current_slice != 0) {
99
-        if (last_pic_structure != h->picture_structure ||
100
-            last_pic_droppable != h->droppable) {
101
+    if (h0->current_slice) {
102
+        if (last_pic_structure != picture_structure ||
103
+            last_pic_droppable != droppable) {
104
             av_log(h->avctx, AV_LOG_ERROR,
105
                    "Changing field mode (%d -> %d) between slices is not allowed\n",
106
                    last_pic_structure, h->picture_structure);
107
-            h->picture_structure = last_pic_structure;
108
-            h->droppable         = last_pic_droppable;
109
             return AVERROR_INVALIDDATA;
110
         } else if (!h0->cur_pic_ptr) {
111
             av_log(h->avctx, AV_LOG_ERROR,
112
@@ -3360,7 +3377,14 @@
113
                    h0->current_slice + 1);
114
             return AVERROR_INVALIDDATA;
115
         }
116
-    } else {
117
+    }
118
+
119
+    h->picture_structure = picture_structure;
120
+    h->droppable         = droppable;
121
+    h->frame_num         = frame_num;
122
+    h->mb_field_decoding_flag = picture_structure != PICT_FRAME;
123
+
124
+    if (h0->current_slice == 0) {
125
         /* Shorten frame num gaps so we don't have to allocate reference
126
          * frames just to throw them away */
127
         if (h->frame_num != h->prev_frame_num) {
128
ffmpeg-1.2.11.tar.bz2/libavcodec/h264_cabac.c -> ffmpeg-1.2.12.tar.bz2/libavcodec/h264_cabac.c Changed
10
 
1
@@ -1278,7 +1278,7 @@
2
 }
3
 
4
 static int decode_cabac_field_decoding_flag(H264Context *h) {
5
-    const long mbb_xy = h->mb_xy - 2L*h->mb_stride;
6
+    const int mbb_xy = h->mb_xy - 2*h->mb_stride;
7
 
8
     unsigned long ctx = 0;
9
 
10
ffmpeg-1.2.11.tar.bz2/libavcodec/h264_ps.c -> ffmpeg-1.2.12.tar.bz2/libavcodec/h264_ps.c Changed
12
 
1
@@ -379,7 +379,9 @@
2
         }
3
         sps->bit_depth_luma   = get_ue_golomb(&h->gb) + 8;
4
         sps->bit_depth_chroma = get_ue_golomb(&h->gb) + 8;
5
-        if (sps->bit_depth_luma > 14U || sps->bit_depth_chroma > 14U || sps->bit_depth_luma != sps->bit_depth_chroma) {
6
+        if (sps->bit_depth_luma   < 8 || sps->bit_depth_luma   > 14 ||
7
+            sps->bit_depth_chroma < 8 || sps->bit_depth_chroma > 14 ||
8
+            sps->bit_depth_luma != sps->bit_depth_chroma) {
9
             av_log(h->avctx, AV_LOG_ERROR, "illegal bit depth value (%d, %d)\n",
10
                    sps->bit_depth_luma, sps->bit_depth_chroma);
11
             goto fail;
12
ffmpeg-1.2.11.tar.bz2/libavcodec/mjpegdec.c -> ffmpeg-1.2.12.tar.bz2/libavcodec/mjpegdec.c Changed
62
 
1
@@ -437,9 +437,12 @@
2
     }
3
     if (s->ls) {
4
         s->upscale_h = s->upscale_v = 0;
5
-        if (s->nb_components > 1)
6
+        if (s->nb_components == 3) {
7
             s->avctx->pix_fmt = AV_PIX_FMT_RGB24;
8
-        else if (s->bits <= 8)
9
+        } else if (s->nb_components != 1) {
10
+            av_log(s->avctx, AV_LOG_ERROR, "Unsupported number of components %d\n", s->nb_components);
11
+            return AVERROR_PATCHWELCOME;
12
+        } else if (s->bits <= 8)
13
             s->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
14
         else
15
             s->avctx->pix_fmt = AV_PIX_FMT_GRAY16;
16
@@ -1080,13 +1083,18 @@
17
 
18
                     if (s->interlaced && s->bottom_field)
19
                         block_offset += linesize[c] >> 1;
20
-                    ptr = data[c] + block_offset;
21
+                    if (   8*(h * mb_x + x) < s->width
22
+                        && 8*(v * mb_y + y) < s->height) {
23
+                        ptr = data[c] + block_offset;
24
+                    } else
25
+                        ptr = NULL;
26
                     if (!s->progressive) {
27
-                        if (copy_mb)
28
-                            mjpeg_copy_block(s, ptr, reference_data[c] + block_offset,
29
-                                             linesize[c], s->avctx->lowres);
30
+                        if (copy_mb) {
31
+                            if (ptr)
32
+                                mjpeg_copy_block(s, ptr, reference_data[c] + block_offset,
33
+                                                linesize[c], s->avctx->lowres);
34
 
35
-                        else {
36
+                        } else {
37
                             s->dsp.clear_block(s->block);
38
                             if (decode_block(s, s->block, i,
39
                                              s->dc_index[i], s->ac_index[i],
40
@@ -1095,7 +1103,9 @@
41
                                        "error y=%d x=%d\n", mb_y, mb_x);
42
                                 return AVERROR_INVALIDDATA;
43
                             }
44
-                            s->dsp.idct_put(ptr, linesize[c], s->block);
45
+                            if (ptr) {
46
+                                s->dsp.idct_put(ptr, linesize[c], s->block);
47
+                            }
48
                         }
49
                     } else {
50
                         int block_idx  = s->block_stride[c] * (v * mb_y + y) +
51
@@ -1631,6 +1641,10 @@
52
             put_bits(&pb, 8, x);
53
             if (x == 0xFF) {
54
                 x = src[b++];
55
+                if (x & 0x80) {
56
+                    av_log(s->avctx, AV_LOG_WARNING, "Invalid escape sequence\n");
57
+                    x &= 0x7f;
58
+                }
59
                 put_bits(&pb, 7, x);
60
                 bit_count--;
61
             }
62
ffmpeg-1.2.11.tar.bz2/libavcodec/mpegvideo_enc.c -> ffmpeg-1.2.12.tar.bz2/libavcodec/mpegvideo_enc.c Changed
24
 
1
@@ -412,18 +412,18 @@
2
         switch(avctx->codec_id) {
3
         case AV_CODEC_ID_MPEG1VIDEO:
4
         case AV_CODEC_ID_MPEG2VIDEO:
5
-            avctx->rc_buffer_size = FFMAX(avctx->rc_max_rate, 15000000) * 112L / 15000000 * 16384;
6
+            avctx->rc_buffer_size = FFMAX(avctx->rc_max_rate, 15000000) * 112LL / 15000000 * 16384;
7
             break;
8
         case AV_CODEC_ID_MPEG4:
9
         case AV_CODEC_ID_MSMPEG4V1:
10
         case AV_CODEC_ID_MSMPEG4V2:
11
         case AV_CODEC_ID_MSMPEG4V3:
12
             if       (avctx->rc_max_rate >= 15000000) {
13
-                avctx->rc_buffer_size = 320 + (avctx->rc_max_rate - 15000000L) * (760-320) / (38400000 - 15000000);
14
+                avctx->rc_buffer_size = 320 + (avctx->rc_max_rate - 15000000LL) * (760-320) / (38400000 - 15000000);
15
             } else if(avctx->rc_max_rate >=  2000000) {
16
-                avctx->rc_buffer_size =  80 + (avctx->rc_max_rate -  2000000L) * (320- 80) / (15000000 -  2000000);
17
+                avctx->rc_buffer_size =  80 + (avctx->rc_max_rate -  2000000LL) * (320- 80) / (15000000 -  2000000);
18
             } else if(avctx->rc_max_rate >=   384000) {
19
-                avctx->rc_buffer_size =  40 + (avctx->rc_max_rate -   384000L) * ( 80- 40) / ( 2000000 -   384000);
20
+                avctx->rc_buffer_size =  40 + (avctx->rc_max_rate -   384000LL) * ( 80- 40) / ( 2000000 -   384000);
21
             } else
22
                 avctx->rc_buffer_size = 40;
23
             avctx->rc_buffer_size *= 16384;
24
ffmpeg-1.2.11.tar.bz2/libavformat/cdxl.c -> ffmpeg-1.2.12.tar.bz2/libavformat/cdxl.c Changed
10
 
1
@@ -127,6 +127,8 @@
2
     height       = AV_RB16(&cdxl->header[16]);
3
     palette_size = AV_RB16(&cdxl->header[20]);
4
     audio_size   = AV_RB16(&cdxl->header[22]);
5
+    if (FFALIGN(width, 16) * (uint64_t)height * cdxl->header[19] > INT_MAX)
6
+        return AVERROR_INVALIDDATA;
7
     image_size   = FFALIGN(width, 16) * height * cdxl->header[19] / 8;
8
     video_size   = palette_size + image_size;
9
 
10
ffmpeg-1.2.11.tar.bz2/libavformat/flvdec.c -> ffmpeg-1.2.12.tar.bz2/libavformat/flvdec.c Changed
10
 
1
@@ -333,7 +333,7 @@
2
     FLVContext *flv = s->priv_data;
3
     AVIOContext *ioc;
4
     AMFDataType amf_type;
5
-    char str_val[256];
6
+    char str_val[1024];
7
     double num_val;
8
 
9
     num_val = 0;
10
ffmpeg-1.2.11.tar.bz2/libavformat/matroskadec.c -> ffmpeg-1.2.12.tar.bz2/libavformat/matroskadec.c Changed
48
 
1
@@ -991,7 +991,7 @@
2
                 char *ptr = list->elem;
3
                 for (j=0; j<list->nb_elem; j++, ptr+=syntax[i].list_elem_size)
4
                     ebml_free(syntax[i].def.n, ptr);
5
-                av_free(list->elem);
6
+                av_freep(&list->elem);
7
             } else
8
                 ebml_free(syntax[i].def.n, data_off);
9
         default:  break;
10
@@ -1789,8 +1789,8 @@
11
                 av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
12
                           1000000000, track->default_duration, 30000);
13
 #if FF_API_R_FRAME_RATE
14
-                if (   st->avg_frame_rate.num < st->avg_frame_rate.den * 1000L
15
-                    && st->avg_frame_rate.num > st->avg_frame_rate.den * 5L)
16
+                if (   st->avg_frame_rate.num < st->avg_frame_rate.den * 1000LL
17
+                    && st->avg_frame_rate.num > st->avg_frame_rate.den * 5LL)
18
                     st->r_frame_rate = st->avg_frame_rate;
19
 #endif
20
             }
21
@@ -1891,7 +1891,7 @@
22
 {
23
     if (matroska->num_packets > 0) {
24
         memcpy(pkt, matroska->packets[0], sizeof(AVPacket));
25
-        av_free(matroska->packets[0]);
26
+        av_freep(&matroska->packets[0]);
27
         if (matroska->num_packets > 1) {
28
             void *newpackets;
29
             memmove(&matroska->packets[0], &matroska->packets[1],
30
@@ -1921,7 +1921,7 @@
31
         int n;
32
         for (n = 0; n < matroska->num_packets; n++) {
33
             av_free_packet(matroska->packets[n]);
34
-            av_free(matroska->packets[n]);
35
+            av_freep(&matroska->packets[n]);
36
         }
37
         av_freep(&matroska->packets);
38
         matroska->num_packets = 0;
39
@@ -2514,7 +2514,7 @@
40
 
41
     for (n=0; n < matroska->tracks.nb_elem; n++)
42
         if (tracks[n].type == MATROSKA_TRACK_TYPE_AUDIO)
43
-            av_free(tracks[n].audio.buf);
44
+            av_freep(&tracks[n].audio.buf);
45
     ebml_free(matroska_cluster, &matroska->current_cluster);
46
     ebml_free(matroska_segment, matroska);
47
 
48
ffmpeg-1.2.11.tar.bz2/libavformat/mov.c -> ffmpeg-1.2.12.tar.bz2/libavformat/mov.c Changed
54
 
1
@@ -281,7 +281,11 @@
2
 static int mov_metadata_raw(MOVContext *c, AVIOContext *pb,
3
                             unsigned len, const char *key)
4
 {
5
-    char *value = av_malloc(len + 1);
6
+    char *value;
7
+    // Check for overflow.
8
+    if (len >= INT_MAX)
9
+        return AVERROR(EINVAL);
10
+    value = av_malloc(len + 1);
11
     if (!value)
12
         return AVERROR(ENOMEM);
13
     avio_read(pb, value, len);
14
@@ -385,7 +389,7 @@
15
 
16
     if (!key)
17
         return 0;
18
-    if (atom.size < 0)
19
+    if (atom.size < 0 || str_size >= INT_MAX/2)
20
         return AVERROR_INVALIDDATA;
21
 
22
     str_size = FFMIN3(sizeof(str)-1, str_size, atom.size);
23
@@ -1162,6 +1166,10 @@
24
     if (entries >= UINT_MAX/sizeof(int64_t))
25
         return AVERROR_INVALIDDATA;
26
 
27
+    if (sc->chunk_offsets)
28
+        av_log(c->fc, AV_LOG_WARNING, "Duplicate STCO atom\n");
29
+    av_free(sc->chunk_offsets);
30
+    sc->chunk_count = 0;
31
     sc->chunk_offsets = av_malloc(entries * sizeof(int64_t));
32
     if (!sc->chunk_offsets)
33
         return AVERROR(ENOMEM);
34
@@ -1607,6 +1615,10 @@
35
         return 0;
36
     if (entries >= UINT_MAX / sizeof(*sc->stsc_data))
37
         return AVERROR_INVALIDDATA;
38
+    if (sc->stsc_data)
39
+        av_log(c->fc, AV_LOG_WARNING, "Duplicate STSC atom\n");
40
+    av_free(sc->stsc_data);
41
+    sc->stsc_count = 0;
42
     sc->stsc_data = av_malloc(entries * sizeof(*sc->stsc_data));
43
     if (!sc->stsc_data)
44
         return AVERROR(ENOMEM);
45
@@ -2815,7 +2827,7 @@
46
                 }
47
             }
48
             total_size += 8;
49
-            if (a.size == 1) { /* 64 bit extended size */
50
+            if (a.size == 1 && total_size + 8 <= atom.size) { /* 64 bit extended size */
51
                 a.size = avio_rb64(pb) - 8;
52
                 total_size += 8;
53
             }
54
ffmpeg-1.2.11.tar.bz2/libavformat/movenc.c -> ffmpeg-1.2.12.tar.bz2/libavformat/movenc.c Changed
11
 
1
@@ -1894,7 +1894,8 @@
2
     }
3
 
4
     version = max_track_len < UINT32_MAX ? 0 : 1;
5
-    (version == 1) ? avio_wb32(pb, 120) : avio_wb32(pb, 108); /* size */
6
+    avio_wb32(pb, version == 1 ? 120 : 108); /* size */
7
+
8
     ffio_wfourcc(pb, "mvhd");
9
     avio_w8(pb, version);
10
     avio_wb24(pb, 0); /* flags */
11
ffmpeg-1.2.11.tar.bz2/libavformat/mpc8.c -> ffmpeg-1.2.12.tar.bz2/libavformat/mpc8.c Changed
39
 
1
@@ -57,7 +57,7 @@
2
 
3
 static inline int64_t bs_get_v(const uint8_t **bs)
4
 {
5
-    int64_t v = 0;
6
+    uint64_t v = 0;
7
     int br = 0;
8
     int c;
9
 
10
@@ -91,7 +91,7 @@
11
         size = bs_get_v(&bs);
12
         if (size < 2)
13
             return 0;
14
-        if (bs + size - 2 >= bs_end)
15
+        if (size >= bs_end - bs + 2)
16
             return AVPROBE_SCORE_MAX / 4 - 1; //seems to be valid MPC but no header yet
17
         if (header_found) {
18
             if (size < 11 || size > 28)
19
@@ -108,7 +108,7 @@
20
 
21
 static inline int64_t gb_get_v(GetBitContext *gb)
22
 {
23
-    int64_t v = 0;
24
+    uint64_t v = 0;
25
     int bits = 0;
26
     while(get_bits1(gb) && bits < 64-7){
27
         v <<= 7;
28
@@ -216,6 +216,10 @@
29
     while(!url_feof(pb)){
30
         pos = avio_tell(pb);
31
         mpc8_get_chunk_header(pb, &tag, &size);
32
+        if (size < 0) {
33
+            av_log(s, AV_LOG_ERROR, "Invalid chunk length\n");
34
+            return AVERROR_INVALIDDATA;
35
+        }
36
         if(tag == TAG_STREAMHDR)
37
             break;
38
         mpc8_handle_chunk(s, tag, pos, size);
39
ffmpeg-1.2.11.tar.bz2/libavformat/rmdec.c -> ffmpeg-1.2.12.tar.bz2/libavformat/rmdec.c Changed
14
 
1
@@ -389,7 +389,11 @@
2
 skip:
3
     /* skip codec info */
4
     size = avio_tell(pb) - codec_pos;
5
-    avio_skip(pb, codec_data_size - size);
6
+    if (codec_data_size >= size) {
7
+        avio_skip(pb, codec_data_size - size);
8
+    } else {
9
+        av_log(s, AV_LOG_WARNING, "codec_data_size %u < size %d\n", codec_data_size, size);
10
+    }
11
 
12
     return 0;
13
 }
14
ffmpeg-1.2.11.tar.bz2/libavformat/rtpdec_h263_rfc2190.c -> ffmpeg-1.2.12.tar.bz2/libavformat/rtpdec_h263_rfc2190.c Changed
9
 
1
@@ -82,6 +82,7 @@
2
         avio_close_dyn_buf(data->buf, &p);
3
         av_free(p);
4
         data->buf = NULL;
5
+        data->endbyte_bits = 0;
6
     }
7
 
8
     if (len < 4) {
9
ffmpeg-1.2.11.tar.bz2/libavformat/segment.c -> ffmpeg-1.2.12.tar.bz2/libavformat/segment.c Changed
14
 
1
@@ -717,12 +717,6 @@
2
     if (pkt->stream_index == seg->reference_stream_index)
3
         seg->frame_count++;
4
 
5
-    if (ret < 0) {
6
-        if (seg->list)
7
-            avio_close(seg->list_pb);
8
-        avformat_free_context(oc);
9
-    }
10
-
11
     return ret;
12
 }
13
 
14
ffmpeg-1.2.11.tar.bz2/libavformat/smacker.c -> ffmpeg-1.2.12.tar.bz2/libavformat/smacker.c Changed
10
 
1
@@ -309,7 +309,7 @@
2
                 uint8_t *tmpbuf;
3
 
4
                 size = avio_rl32(s->pb) - 4;
5
-                if(size + 4L > frame_size)
6
+                if(size + 4LL > frame_size)
7
                     return AVERROR_INVALIDDATA;
8
                 frame_size -= size;
9
                 frame_size -= 4;
10
ffmpeg-1.2.11.tar.bz2/libavformat/thp.c -> ffmpeg-1.2.12.tar.bz2/libavformat/thp.c Changed
10
 
1
@@ -180,6 +180,8 @@
2
         pkt->stream_index = thp->video_stream_index;
3
     } else {
4
         ret = av_get_packet(pb, pkt, thp->audiosize);
5
+        if (ret < 0)
6
+            return ret;
7
         if (ret != thp->audiosize) {
8
             av_free_packet(pkt);
9
             return AVERROR(EIO);
10
ffmpeg-1.2.11.tar.bz2/libavformat/tta.c -> ffmpeg-1.2.12.tar.bz2/libavformat/tta.c Changed
26
 
1
@@ -96,8 +96,10 @@
2
 
3
     for (i = 0; i < c->totalframes; i++) {
4
         uint32_t size = avio_rl32(s->pb);
5
-        av_add_index_entry(st, framepos, i * c->frame_size, size, 0,
6
-                           AVINDEX_KEYFRAME);
7
+        int r;
8
+        if ((r = av_add_index_entry(st, framepos, i * c->frame_size, size, 0,
9
+                                    AVINDEX_KEYFRAME)) < 0)
10
+            return r;
11
         framepos += size;
12
     }
13
     avio_skip(s->pb, 4); // seektable crc
14
@@ -135,6 +137,11 @@
15
     if (c->currentframe >= c->totalframes)
16
         return AVERROR_EOF;
17
 
18
+    if (st->nb_index_entries < c->totalframes) {
19
+        av_log(s, AV_LOG_ERROR, "Index entry disappeared\n");
20
+        return AVERROR_INVALIDDATA;
21
+    }
22
+
23
     size = st->index_entries[c->currentframe].size;
24
 
25
     ret = av_get_packet(s->pb, pkt, size);
26
ffmpeg-1.2.11.tar.bz2/libavformat/utils.c -> ffmpeg-1.2.12.tar.bz2/libavformat/utils.c Changed
12
 
1
@@ -2675,8 +2675,8 @@
2
  * And there are "variable" fps files this needs to detect as well.
3
  */
4
 static int tb_unreliable(AVCodecContext *c){
5
-    if(   c->time_base.den >= 101L*c->time_base.num
6
-       || c->time_base.den <    5L*c->time_base.num
7
+    if(   c->time_base.den >= 101LL*c->time_base.num
8
+       || c->time_base.den <    5LL*c->time_base.num
9
 /*       || c->codec_tag == AV_RL32("DIVX")
10
        || c->codec_tag == AV_RL32("XVID")*/
11
        || c->codec_tag == AV_RL32("mp4v")
12
ffmpeg-1.2.11.tar.bz2/libavutil/opt.c -> ffmpeg-1.2.12.tar.bz2/libavutil/opt.c Changed
33
 
1
@@ -74,8 +74,8 @@
2
 {
3
     switch (o->type) {
4
     case AV_OPT_TYPE_FLAGS:     *intnum = *(unsigned int*)dst;return 0;
5
-    case AV_OPT_TYPE_PIXEL_FMT:
6
-    case AV_OPT_TYPE_SAMPLE_FMT:
7
+    case AV_OPT_TYPE_PIXEL_FMT: *intnum = *(enum AVPixelFormat *)dst;return 0;
8
+    case AV_OPT_TYPE_SAMPLE_FMT:*intnum = *(enum AVSampleFormat*)dst;return 0;
9
     case AV_OPT_TYPE_INT:       *intnum = *(int         *)dst;return 0;
10
     case AV_OPT_TYPE_INT64:     *intnum = *(int64_t     *)dst;return 0;
11
     case AV_OPT_TYPE_FLOAT:     *num    = *(float       *)dst;return 0;
12
@@ -97,9 +97,9 @@
13
     }
14
 
15
     switch (o->type) {
16
+    case AV_OPT_TYPE_PIXEL_FMT: *(enum AVPixelFormat *)dst = llrint(num/den) * intnum; break;
17
+    case AV_OPT_TYPE_SAMPLE_FMT:*(enum AVSampleFormat*)dst = llrint(num/den) * intnum; break;
18
     case AV_OPT_TYPE_FLAGS:
19
-    case AV_OPT_TYPE_PIXEL_FMT:
20
-    case AV_OPT_TYPE_SAMPLE_FMT:
21
     case AV_OPT_TYPE_INT:   *(int       *)dst= llrint(num/den)*intnum; break;
22
     case AV_OPT_TYPE_INT64: *(int64_t   *)dst= llrint(num/den)*intnum; break;
23
     case AV_OPT_TYPE_FLOAT: *(float     *)dst= num*intnum/den;         break;
24
@@ -149,6 +149,8 @@
25
     len /= 2;
26
 
27
     ptr = bin = av_malloc(len);
28
+    if (!ptr)
29
+        return AVERROR(ENOMEM);
30
     while (*val) {
31
         int a = hexchar2int(*val++);
32
         int b = hexchar2int(*val++);
33
ffmpeg-1.2.11.tar.bz2/libswresample/dither.c -> ffmpeg-1.2.12.tar.bz2/libswresample/dither.c Changed
21
 
1
@@ -84,13 +84,13 @@
2
     in_fmt  = av_get_packed_sample_fmt( in_fmt);
3
 
4
     if(in_fmt == AV_SAMPLE_FMT_FLT || in_fmt == AV_SAMPLE_FMT_DBL){
5
-        if(out_fmt == AV_SAMPLE_FMT_S32) scale = 1.0/(1L<<31);
6
-        if(out_fmt == AV_SAMPLE_FMT_S16) scale = 1.0/(1L<<15);
7
-        if(out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1.0/(1L<< 7);
8
+        if(out_fmt == AV_SAMPLE_FMT_S32) scale = 1.0/(1LL<<31);
9
+        if(out_fmt == AV_SAMPLE_FMT_S16) scale = 1.0/(1LL<<15);
10
+        if(out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1.0/(1LL<< 7);
11
     }
12
-    if(in_fmt == AV_SAMPLE_FMT_S32 && out_fmt == AV_SAMPLE_FMT_S16) scale = 1L<<16;
13
-    if(in_fmt == AV_SAMPLE_FMT_S32 && out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1L<<24;
14
-    if(in_fmt == AV_SAMPLE_FMT_S16 && out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1L<<8;
15
+    if(in_fmt == AV_SAMPLE_FMT_S32 && out_fmt == AV_SAMPLE_FMT_S16) scale = 1<<16;
16
+    if(in_fmt == AV_SAMPLE_FMT_S32 && out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1<<24;
17
+    if(in_fmt == AV_SAMPLE_FMT_S16 && out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1<<8;
18
 
19
     scale *= s->dither.scale;
20
 
21
ffmpeg-1.2.11.tar.bz2/libswscale/utils.c -> ffmpeg-1.2.12.tar.bz2/libswscale/utils.c Changed
19
 
1
@@ -571,14 +571,15 @@
2
         }
3
 
4
         if ((*filterPos)[i] + filterSize > srcW) {
5
-            int shift = (*filterPos)[i] + filterSize - srcW;
6
+            int shift = (*filterPos)[i] + FFMIN(filterSize - srcW, 0);
7
+
8
             // move filter coefficients right to compensate for filterPos
9
             for (j = filterSize - 2; j >= 0; j--) {
10
                 int right = FFMIN(j + shift, filterSize - 1);
11
                 filter[i * filterSize + right] += filter[i * filterSize + j];
12
                 filter[i * filterSize + j]      = 0;
13
             }
14
-            (*filterPos)[i]= srcW - filterSize;
15
+            (*filterPos)[i]-= shift;
16
         }
17
     }
18
 
19
ffmpeg-1.2.11.tar.bz2/libswscale/yuv2rgb.c -> ffmpeg-1.2.12.tar.bz2/libswscale/yuv2rgb.c Changed
70
 
1
@@ -782,9 +782,13 @@
2
 
3
     av_free(c->yuvTable);
4
 
5
+#define ALLOC_YUV_TABLE(x)          \
6
+        c->yuvTable = av_malloc(x); \
7
+        if (!c->yuvTable)           \
8
+            return AVERROR(ENOMEM);
9
     switch (bpp) {
10
     case 1:
11
-        c->yuvTable = av_malloc(1024);
12
+        ALLOC_YUV_TABLE(1024);
13
         y_table     = c->yuvTable;
14
         yb = -(384 << 16) - oy;
15
         for (i = 0; i < 1024 - 110; i++) {
16
@@ -799,7 +803,7 @@
17
         rbase       = isRgb ? 3 : 0;
18
         gbase       = 1;
19
         bbase       = isRgb ? 0 : 3;
20
-        c->yuvTable = av_malloc(1024 * 3);
21
+        ALLOC_YUV_TABLE(1024 * 3);
22
         y_table     = c->yuvTable;
23
         yb = -(384 << 16) - oy;
24
         for (i = 0; i < 1024 - 110; i++) {
25
@@ -818,7 +822,7 @@
26
         rbase       = isRgb ? 5 : 0;
27
         gbase       = isRgb ? 2 : 3;
28
         bbase       = isRgb ? 0 : 6;
29
-        c->yuvTable = av_malloc(1024 * 3);
30
+        ALLOC_YUV_TABLE(1024 * 3);
31
         y_table     = c->yuvTable;
32
         yb = -(384 << 16) - oy;
33
         for (i = 0; i < 1024 - 38; i++) {
34
@@ -837,7 +841,7 @@
35
         rbase       = isRgb ? 8 : 0;
36
         gbase       = 4;
37
         bbase       = isRgb ? 0 : 8;
38
-        c->yuvTable = av_malloc(1024 * 3 * 2);
39
+        ALLOC_YUV_TABLE(1024 * 3 * 2);
40
         y_table16   = c->yuvTable;
41
         yb = -(384 << 16) - oy;
42
         for (i = 0; i < 1024; i++) {
43
@@ -860,7 +864,7 @@
44
         rbase       = isRgb ? bpp - 5 : 0;
45
         gbase       = 5;
46
         bbase       = isRgb ? 0 : (bpp - 5);
47
-        c->yuvTable = av_malloc(1024 * 3 * 2);
48
+        ALLOC_YUV_TABLE(1024 * 3 * 2);
49
         y_table16   = c->yuvTable;
50
         yb = -(384 << 16) - oy;
51
         for (i = 0; i < 1024; i++) {
52
@@ -880,7 +884,7 @@
53
         break;
54
     case 24:
55
     case 48:
56
-        c->yuvTable = av_malloc(1024);
57
+        ALLOC_YUV_TABLE(1024);
58
         y_table     = c->yuvTable;
59
         yb = -(384 << 16) - oy;
60
         for (i = 0; i < 1024; i++) {
61
@@ -901,7 +905,7 @@
62
         needAlpha = CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat);
63
         if (!needAlpha)
64
             abase = (base + 24) & 31;
65
-        c->yuvTable = av_malloc(1024 * 3 * 4);
66
+        ALLOC_YUV_TABLE(1024 * 3 * 4);
67
         y_table32   = c->yuvTable;
68
         yb = -(384 << 16) - oy;
69
         for (i = 0; i < 1024; i++) {
70
Refresh

No build results available

Refresh

No rpmlint results available

Request History
enzokiel's avatar

enzokiel created request about 10 years ago

- update internal ffmpeg to version 1.2.12


enzokiel's avatar

enzokiel accepted request about 10 years ago

OK.