]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cavsdec.c
mips: add assembler flags for mips32r2 ISA and mhard-float
[ffmpeg] / libavcodec / cavsdec.c
index a4645127734b217f8a4b1761847284a12d24be62..099599ae510b59f4511de854ba700a4c4d59fb68 100644 (file)
@@ -25,6 +25,7 @@
  * @author Stefan Gehrer <stefan.gehrer@gmx.de>
  */
 
+#include "libavutil/avassert.h"
 #include "avcodec.h"
 #include "get_bits.h"
 #include "golomb.h"
@@ -372,7 +373,7 @@ static void decode_mb_b(AVSContext *h, enum cavs_mb mb_type) {
         }
         break;
     default:
-        assert((mb_type > B_SYM_16X16) && (mb_type < B_8X8));
+        av_assert2((mb_type > B_SYM_16X16) && (mb_type < B_8X8));
         flags = ff_cavs_partition_flags[mb_type];
         if(mb_type & 1) { /* 16x8 macroblock types */
             if(flags & FWD0)
@@ -624,6 +625,10 @@ static int decode_seq_header(AVSContext *h) {
         av_log_missing_feature(s, "Width/height changing in CAVS is", 0);
         return -1;
     }
+    if (width <= 0 || height <= 0) {
+        av_log(s, AV_LOG_ERROR, "Dimensions invalid\n");
+        return AVERROR_INVALIDDATA;
+    }
     s->width  = width;
     s->height = height;
     skip_bits(&s->gb,2); //chroma format
@@ -732,12 +737,12 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
 AVCodec ff_cavs_decoder = {
     .name           = "cavs",
     .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = CODEC_ID_CAVS,
+    .id             = AV_CODEC_ID_CAVS,
     .priv_data_size = sizeof(AVSContext),
     .init           = ff_cavs_init,
     .close          = ff_cavs_end,
     .decode         = cavs_decode_frame,
     .capabilities   = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
     .flush          = cavs_flush,
-    .long_name      = NULL_IF_CONFIG_SMALL("Chinese AVS video (AVS1-P2, JiZhun profile)"),
+    .long_name      = NULL_IF_CONFIG_SMALL("Chinese AVS (Audio Video Standard) (AVS1-P2, JiZhun profile)"),
 };