* @author Stefan Gehrer <stefan.gehrer@gmx.de>
*/
+#include "libavutil/avassert.h"
#include "avcodec.h"
#include "get_bits.h"
#include "golomb.h"
}
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)
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
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)"),
};