]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mov.c
Presets support.
[ffmpeg] / libavformat / mov.c
index 1369839d6a50ef849c0f1dd0851e5bda06d1ce1b..76c25a3e4d6de9d22f1d54d7f99f8bbabb3a0762 100644 (file)
@@ -408,7 +408,7 @@ static int mov_read_esds(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
                 MPEG4AudioConfig cfg;
                 ff_mpeg4audio_get_config(&cfg, st->codec->extradata,
                                          st->codec->extradata_size);
-                if (!cfg.chan_config || cfg.chan_config > 7)
+                if (cfg.chan_config > 7)
                     return -1;
                 st->codec->channels = ff_mpeg4audio_channels[cfg.chan_config];
                 if (cfg.object_type == 29 && cfg.sampling_index < 3) // old mp3on4
@@ -1565,7 +1565,7 @@ static int mov_read_cmov(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
     uint8_t *cmov_data;
     uint8_t *moov_data; /* uncompressed data */
     long cmov_len, moov_len;
-    int ret;
+    int ret = -1;
 
     get_be32(pb); /* dcom atom */
     if (get_le32(pb) != MKTAG('d','c','o','m'))
@@ -1590,9 +1590,9 @@ static int mov_read_cmov(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
     }
     get_buffer(pb, cmov_data, cmov_len);
     if(uncompress (moov_data, (uLongf *) &moov_len, (const Bytef *)cmov_data, cmov_len) != Z_OK)
-        return -1;
+        goto free_and_return;
     if(init_put_byte(&ctx, moov_data, moov_len, 0, NULL, NULL, NULL, NULL) != 0)
-        return -1;
+        goto free_and_return;
     atom.type = MKTAG('m','o','o','v');
     atom.offset = 0;
     atom.size = moov_len;
@@ -1600,6 +1600,7 @@ static int mov_read_cmov(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
 //    { int fd = open("/tmp/uncompheader.mov", O_WRONLY | O_CREAT); write(fd, moov_data, moov_len); close(fd); }
 #endif
     ret = mov_read_default(c, &ctx, atom);
+free_and_return:
     av_free(moov_data);
     av_free(cmov_data);
     return ret;
@@ -1913,7 +1914,7 @@ static int mov_read_close(AVFormatContext *s)
 
 AVInputFormat mov_demuxer = {
     "mov,mp4,m4a,3gp,3g2,mj2",
-    "QuickTime/MPEG4/Motion JPEG 2000 format",
+    NULL_IF_CONFIG_SMALL("QuickTime/MPEG-4/Motion JPEG 2000 format"),
     sizeof(MOVContext),
     mov_probe,
     mov_read_header,