+/**
+ * Decode Indeo 4 picture header.
+ *
+ * @param[in,out] ctx pointer to the decoder context
+ * @param[in] avctx pointer to the AVCodecContext
+ * @return result code: 0 = OK, negative number = error
+ */
+static int decode_pic_hdr(IVI4DecContext *ctx, AVCodecContext *avctx)
+{
+ int pic_size_indx, val, i, p;
+ IVIPicConfig pic_conf;
+
+ if (get_bits(&ctx->gb, 18) != 0x3FFF8) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid picture start code!\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ ctx->prev_frame_type = ctx->frame_type;
+ ctx->frame_type = get_bits(&ctx->gb, 3);
+ if (ctx->frame_type == 7) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid frame type: %d\n",
ctx->frame_type);
+ return AVERROR_INVALIDDATA;
+ }
Maybe add the other frametypes that aren't defined also (1,6).
1 has to do with b-frames and 6 seems to be a null frame. Add them for clarity
in the frametype enum.
+#if IVI4_STREAM_ANALYSER
+ if (ctx->frame_type == 1 || ctx->frame_type == 3)
Use the actual enum defines. (1 is missing though.)
+ ctx->frame_num = get_bits1(&ctx->gb) ? get_bits_long(&ctx->gb, 20) : 0;
+
This might not need the _long() version of the function.
Other then that patch LGTM, so commit it and let the GCI students fuzz it apart.
MvH
Benjamin Larsson
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel