]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/westwood_vqa.c
rtspenc: Check the return value from ffio_open_dyn_packet_buf
[ffmpeg] / libavformat / westwood_vqa.c
index 41aa5d897ffec5e290ecfb5a4d29ffede60fe203..77da375e70c835f3a56e89d3b5d31ca11bae7330 100644 (file)
@@ -94,7 +94,7 @@ static int wsvqa_read_header(AVFormatContext *s)
     st->start_time = 0;
     wsvqa->video_stream_index = st->index;
     st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
-    st->codec->codec_id = CODEC_ID_WS_VQA;
+    st->codec->codec_id = AV_CODEC_ID_WS_VQA;
     st->codec->codec_tag = 0;  /* no fourcc */
 
     /* skip to the start of the VQA header */
@@ -106,7 +106,6 @@ static int wsvqa_read_header(AVFormatContext *s)
     header = (unsigned char *)st->codec->extradata;
     if (avio_read(pb, st->codec->extradata, VQA_HEADER_SIZE) !=
         VQA_HEADER_SIZE) {
-        av_free(st->codec->extradata);
         return AVERROR(EIO);
     }
     st->codec->width = AV_RL16(&header[6]);
@@ -132,7 +131,6 @@ static int wsvqa_read_header(AVFormatContext *s)
      * FINF has been skipped and the file will be ready to be demuxed */
     do {
         if (avio_read(pb, scratch, VQA_PREAMBLE_SIZE) != VQA_PREAMBLE_SIZE) {
-            av_free(st->codec->extradata);
             return AVERROR(EIO);
         }
         chunk_tag = AV_RB32(&scratch[0]);
@@ -216,15 +214,15 @@ static int wsvqa_read_packet(AVFormatContext *s,
                     switch (chunk_type) {
                     case SND0_TAG:
                         if (wsvqa->bps == 16)
-                            st->codec->codec_id = CODEC_ID_PCM_S16LE;
+                            st->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
                         else
-                            st->codec->codec_id = CODEC_ID_PCM_U8;
+                            st->codec->codec_id = AV_CODEC_ID_PCM_U8;
                         break;
                     case SND1_TAG:
-                        st->codec->codec_id = CODEC_ID_WESTWOOD_SND1;
+                        st->codec->codec_id = AV_CODEC_ID_WESTWOOD_SND1;
                         break;
                     case SND2_TAG:
-                        st->codec->codec_id = CODEC_ID_ADPCM_IMA_WS;
+                        st->codec->codec_id = AV_CODEC_ID_ADPCM_IMA_WS;
                         st->codec->extradata_size = 2;
                         st->codec->extradata = av_mallocz(2 + FF_INPUT_BUFFER_PADDING_SIZE);
                         if (!st->codec->extradata)
@@ -273,7 +271,7 @@ static int wsvqa_read_packet(AVFormatContext *s,
 
 AVInputFormat ff_wsvqa_demuxer = {
     .name           = "wsvqa",
-    .long_name      = NULL_IF_CONFIG_SMALL("Westwood Studios VQA format"),
+    .long_name      = NULL_IF_CONFIG_SMALL("Westwood Studios VQA"),
     .priv_data_size = sizeof(WsVqaDemuxContext),
     .read_probe     = wsvqa_probe,
     .read_header    = wsvqa_read_header,