]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/hq_hqa.c
avcodec: Constify AVCodecs
[ffmpeg] / libavcodec / hq_hqa.c
index eec2e980b3a40aecd33db59b72955955683b9b76..71753e7cc2ba5871f2d7de66343cbe5b49cef518 100644 (file)
@@ -321,7 +321,7 @@ static int hq_hqa_decode_frame(AVCodecContext *avctx, void *data,
         int info_size;
         bytestream2_skip(&ctx->gbc, 4);
         info_size = bytestream2_get_le32(&ctx->gbc);
-        if (bytestream2_get_bytes_left(&ctx->gbc) < info_size) {
+        if (info_size < 0 || bytestream2_get_bytes_left(&ctx->gbc) < info_size) {
             av_log(avctx, AV_LOG_ERROR, "Invalid INFO size (%d).\n", info_size);
             return AVERROR_INVALIDDATA;
         }
@@ -381,7 +381,7 @@ static av_cold int hq_hqa_decode_close(AVCodecContext *avctx)
     return 0;
 }
 
-AVCodec ff_hq_hqa_decoder = {
+const AVCodec ff_hq_hqa_decoder = {
     .name           = "hq_hqa",
     .long_name      = NULL_IF_CONFIG_SMALL("Canopus HQ/HQA"),
     .type           = AVMEDIA_TYPE_VIDEO,