[SCM] FFmpeg packaging branch, ubuntu.karmic, updated. debian/0.5+svn20090706-1ubuntu3-39-g6c370eb

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Fri Oct 30 23:10:36 UTC 2009


The following commit has been merged in the ubuntu.karmic branch:
commit 6c370eb7bc85c5be62b3e0ee05479731b716b85e
Author: Reinhard Tartler <siretart at tauware.de>
Date:   Sat Oct 31 00:10:17 2009 +0100

    backport svn r18016 aka 'MOV-Support-stz2-Compact-Sample-Size-Box' to fix FTBFS
    
    without this patch, libavformat/mov.c won't compile, as field_size is
    introduced with this commit. While this patch is strictly speaking not
    in scope of an security update, it is easier to stick with upstream and
    backport this patch in addition.

diff --git a/debian/patches/security/mov/0000-MOV-Support-stz2-Compact-Sample-Size-Box.patch b/debian/patches/security/mov/0000-MOV-Support-stz2-Compact-Sample-Size-Box.patch
new file mode 100644
index 0000000..0eff8ac
--- /dev/null
+++ b/debian/patches/security/mov/0000-MOV-Support-stz2-Compact-Sample-Size-Box.patch
@@ -0,0 +1,97 @@
+From 1e6a8e7b1f40e16f79ff63080d58126e8b52ad2c Mon Sep 17 00:00:00 2001
+From: alexc <alexc at 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
+Date: Mon, 16 Mar 2009 16:14:36 +0000
+Subject: [PATCH] MOV: Support stz2 "Compact Sample Size Box"
+
+git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18016 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
+---
+ libavformat/mov.c |   38 ++++++++++++++++++++++++++++++++++++--
+ 1 files changed, 36 insertions(+), 2 deletions(-)
+
+diff --git a/libavformat/mov.c b/libavformat/mov.c
+index e6ac071..36e4bce 100644
+--- a/libavformat/mov.c
++++ b/libavformat/mov.c
+@@ -33,6 +33,7 @@
+ #include "isom.h"
+ #include "libavcodec/mpeg4audio.h"
+ #include "libavcodec/mpegaudiodata.h"
++#include "libavcodec/bitstream.h"
+ 
+ #if CONFIG_ZLIB
+ #include <zlib.h>
+@@ -1127,14 +1128,23 @@ static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+ {
+     AVStream *st = c->fc->streams[c->fc->nb_streams-1];
+     MOVStreamContext *sc = st->priv_data;
+-    unsigned int i, entries, sample_size;
++    unsigned int i, entries, sample_size, field_size, num_bytes;
++    GetBitContext gb;
++    unsigned char* buf;
+ 
+     get_byte(pb); /* version */
+     get_be24(pb); /* flags */
+ 
++    if (atom.type == MKTAG('s','t','s','z')) {
+     sample_size = get_be32(pb);
+     if (!sc->sample_size) /* do not overwrite value computed in stsd */
+         sc->sample_size = sample_size;
++    field_size = 32;
++    } else {
++        sample_size = 0;
++        get_be24(pb); /* reserved */
++        field_size = get_byte(pb);
++    }
+     entries = get_be32(pb);
+ 
+     dprintf(c->fc, "sample_size = %d sample_count = %d\n", sc->sample_size, entries);
+@@ -1143,14 +1153,37 @@ static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+     if (sample_size)
+         return 0;
+ 
++    if (field_size != 4 && field_size != 8 && field_size != 16 && field_size != 32) {
++        av_log(c->fc, AV_LOG_ERROR, "Invalid sample field size %d\n", field_size);
++        return -1;
++    }
++
+     if(entries >= UINT_MAX / sizeof(int))
+         return -1;
+     sc->sample_sizes = av_malloc(entries * sizeof(int));
+     if (!sc->sample_sizes)
+         return AVERROR(ENOMEM);
+ 
++    num_bytes = (entries*field_size+4)>>3;
++
++    buf = av_malloc(num_bytes);
++    if (!buf) {
++        av_freep(&sc->sample_sizes);
++        return AVERROR(ENOMEM);
++    }
++
++    if (get_buffer(pb, buf, num_bytes) < num_bytes) {
++        av_freep(&sc->sample_sizes);
++        av_free(buf);
++        return -1;
++    }
++
++    init_get_bits(&gb, buf, 8*num_bytes);
++
+     for(i=0; i<entries; i++)
+-        sc->sample_sizes[i] = get_be32(pb);
++        sc->sample_sizes[i] = get_bits_long(&gb, field_size);
++
++    av_free(buf);
+     return 0;
+ }
+ 
+@@ -1793,6 +1826,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = {
+ { MKTAG('s','t','s','s'), mov_read_stss }, /* sync sample */
+ { MKTAG('s','t','s','z'), mov_read_stsz }, /* sample size */
+ { MKTAG('s','t','t','s'), mov_read_stts },
++{ MKTAG('s','t','z','2'), mov_read_stsz }, /* compact sample size */
+ { MKTAG('t','k','h','d'), mov_read_tkhd }, /* track header */
+ { MKTAG('t','f','h','d'), mov_read_tfhd }, /* track fragment header */
+ { MKTAG('t','r','a','k'), mov_read_trak },
+-- 
+1.6.3.3
+
diff --git a/debian/patches/security/mov/0003-check-stream-existence-before-assignment-fix-1222.patch b/debian/patches/security/mov/0003-check-stream-existence-before-assignment-fix-1222.patch
index 67f5959..1242c16 100644
--- a/debian/patches/security/mov/0003-check-stream-existence-before-assignment-fix-1222.patch
+++ b/debian/patches/security/mov/0003-check-stream-existence-before-assignment-fix-1222.patch
@@ -10,7 +10,7 @@ git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19259 9553f0bf-9b14-0410
 
 --- a/libavformat/mov.c
 +++ b/libavformat/mov.c
-@@ -238,10 +238,15 @@ static int mov_read_default(MOVContext *
+@@ -239,10 +239,15 @@ static int mov_read_default(MOVContext *
  
  static int mov_read_dref(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
  {
@@ -28,7 +28,7 @@ git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19259 9553f0bf-9b14-0410
      get_be32(pb); // version + flags
      entries = get_be32(pb);
      if (entries >= UINT_MAX / sizeof(*sc->drefs))
-@@ -381,9 +386,13 @@ static const AVCodecTag mp4_audio_types[
+@@ -382,9 +387,13 @@ static const AVCodecTag mp4_audio_types[
  
  static int mov_read_esds(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
  {
@@ -43,7 +43,7 @@ git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19259 9553f0bf-9b14-0410
      get_be32(pb); /* version + flags */
      len = mp4_read_descr(c, pb, &tag);
      if (tag == MP4ESDescrTag) {
-@@ -440,7 +449,12 @@ static int mov_read_pasp(MOVContext *c, 
+@@ -441,7 +450,12 @@ static int mov_read_pasp(MOVContext *c, 
  {
      const int num = get_be32(pb);
      const int den = get_be32(pb);
@@ -57,7 +57,7 @@ git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19259 9553f0bf-9b14-0410
      if (den != 0) {
          if ((st->sample_aspect_ratio.den != 1 || st->sample_aspect_ratio.num) && // default
              (den != st->sample_aspect_ratio.den || num != st->sample_aspect_ratio.num))
-@@ -494,12 +508,18 @@ static int mov_read_moof(MOVContext *c, 
+@@ -495,12 +509,18 @@ static int mov_read_moof(MOVContext *c, 
  
  static int mov_read_mdhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
  {
@@ -79,7 +79,7 @@ git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19259 9553f0bf-9b14-0410
      if (version > 1)
          return -1; /* unsupported */
  
-@@ -561,7 +581,11 @@ static int mov_read_mvhd(MOVContext *c, 
+@@ -562,7 +582,11 @@ static int mov_read_mvhd(MOVContext *c, 
  
  static int mov_read_smi(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
  {
@@ -92,7 +92,7 @@ git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19259 9553f0bf-9b14-0410
  
      if((uint64_t)atom.size > (1<<30))
          return -1;
-@@ -581,9 +605,14 @@ static int mov_read_smi(MOVContext *c, B
+@@ -582,9 +606,14 @@ static int mov_read_smi(MOVContext *c, B
  
  static int mov_read_enda(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
  {
@@ -109,7 +109,7 @@ git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19259 9553f0bf-9b14-0410
      dprintf(c->fc, "enda %d\n", little_endian);
      if (little_endian == 1) {
          switch (st->codec->codec_id) {
-@@ -633,7 +662,11 @@ static int mov_read_extradata(MOVContext
+@@ -634,7 +663,11 @@ static int mov_read_extradata(MOVContext
  
  static int mov_read_wave(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
  {
@@ -122,7 +122,7 @@ git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19259 9553f0bf-9b14-0410
  
      if((uint64_t)atom.size > (1<<30))
          return -1;
-@@ -660,7 +693,11 @@ static int mov_read_wave(MOVContext *c, 
+@@ -661,7 +694,11 @@ static int mov_read_wave(MOVContext *c, 
   */
  static int mov_read_glbl(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
  {
@@ -135,7 +135,7 @@ git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19259 9553f0bf-9b14-0410
  
      if((uint64_t)atom.size > (1<<30))
          return -1;
-@@ -676,10 +713,15 @@ static int mov_read_glbl(MOVContext *c, 
+@@ -677,10 +714,15 @@ static int mov_read_glbl(MOVContext *c, 
  
  static int mov_read_stco(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
  {
@@ -153,7 +153,7 @@ git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19259 9553f0bf-9b14-0410
      get_byte(pb); /* version */
      get_be24(pb); /* flags */
  
-@@ -742,10 +784,15 @@ static enum CodecID mov_get_lpcm_codec_i
+@@ -743,10 +785,15 @@ static enum CodecID mov_get_lpcm_codec_i
  
  static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
  {
@@ -171,7 +171,7 @@ git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19259 9553f0bf-9b14-0410
      get_byte(pb); /* version */
      get_be24(pb); /* flags */
  
-@@ -1064,10 +1111,15 @@ static int mov_read_stsd(MOVContext *c, 
+@@ -1065,10 +1112,15 @@ static int mov_read_stsd(MOVContext *c, 
  
  static int mov_read_stsc(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
  {
@@ -189,7 +189,7 @@ git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19259 9553f0bf-9b14-0410
      get_byte(pb); /* version */
      get_be24(pb); /* flags */
  
-@@ -1092,10 +1144,15 @@ static int mov_read_stsc(MOVContext *c, 
+@@ -1093,10 +1145,15 @@ static int mov_read_stsc(MOVContext *c, 
  
  static int mov_read_stss(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
  {
@@ -207,7 +207,7 @@ git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19259 9553f0bf-9b14-0410
      get_byte(pb); /* version */
      get_be24(pb); /* flags */
  
-@@ -1119,10 +1176,15 @@ static int mov_read_stss(MOVContext *c, 
+@@ -1120,12 +1177,17 @@ static int mov_read_stss(MOVContext *c, 
  
  static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
  {
@@ -215,7 +215,9 @@ git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19259 9553f0bf-9b14-0410
 -    MOVStreamContext *sc = st->priv_data;
 +    AVStream *st;
 +    MOVStreamContext *sc;
-     unsigned int i, entries, sample_size;
+     unsigned int i, entries, sample_size, field_size, num_bytes;
+     GetBitContext gb;
+     unsigned char* buf;
  
 +    if (c->fc->nb_streams < 1)
 +        return 0;
@@ -225,7 +227,7 @@ git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19259 9553f0bf-9b14-0410
      get_byte(pb); /* version */
      get_be24(pb); /* flags */
  
-@@ -1150,12 +1212,17 @@ static int mov_read_stsz(MOVContext *c, 
+@@ -1183,12 +1245,17 @@ static int mov_read_stsz(MOVContext *c, 
  
  static int mov_read_stts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
  {
@@ -245,7 +247,7 @@ git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19259 9553f0bf-9b14-0410
      get_byte(pb); /* version */
      get_be24(pb); /* flags */
      entries = get_be32(pb);
-@@ -1194,10 +1261,15 @@ static int mov_read_stts(MOVContext *c, 
+@@ -1227,10 +1294,15 @@ static int mov_read_stts(MOVContext *c, 
  
  static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
  {
@@ -263,7 +265,7 @@ git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19259 9553f0bf-9b14-0410
      get_byte(pb); /* version */
      get_be24(pb); /* flags */
      entries = get_be32(pb);
-@@ -1504,10 +1576,16 @@ static int mov_read_tkhd(MOVContext *c, 
+@@ -1537,10 +1609,16 @@ static int mov_read_tkhd(MOVContext *c, 
      int height;
      int64_t disp_transform[2];
      int display_matrix[3][2];
diff --git a/debian/patches/series b/debian/patches/series
index b635a33..ed19b72 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -67,6 +67,7 @@ security/mpegaudiodec/0003-Set-data_size-to-0-to-avoid-having-it-uninitialized.p
 security/h264/0001-Check-num_units_in_tick-time_scale-to-be-valid-and-w.patch
 
 # mov security backports
+security/mov/0000-MOV-Support-stz2-Compact-Sample-Size-Box.patch
 security/mov/0001-check-entries-against-field_size-potential-malloc-ov.patch
 security/mov/0002-add-one-missing-check-for-stream-existence-in-read_e.patch
 security/mov/0003-check-stream-existence-before-assignment-fix-1222.patch

-- 
FFmpeg packaging



More information about the pkg-multimedia-commits mailing list