]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/hapenc.c
pgssubdec: reset rle_data_len/rle_remaining_len on allocation error
[ffmpeg] / libavcodec / hapenc.c
index 4a31447c9e61fb6931aeb5314d77424d6b1f4967..bf2ccaa35967d9ed35a1c3dc8dca4456c377c8a9 100644 (file)
@@ -118,7 +118,7 @@ static int hap_compress_frame(AVCodecContext *avctx, uint8_t *dst)
         /* If there is no gain from snappy, just use the raw texture. */
         if (chunk->compressed_size >= chunk->uncompressed_size) {
             av_log(avctx, AV_LOG_VERBOSE,
-                   "Snappy buffer bigger than uncompressed (%lu >= %lu bytes).\n",
+                   "Snappy buffer bigger than uncompressed (%zu >= %zu bytes).\n",
                    chunk->compressed_size, chunk->uncompressed_size);
             memcpy(chunk_dst, chunk_src, chunk->uncompressed_size);
             chunk->compressor = HAP_COMP_NONE;
@@ -242,16 +242,19 @@ static av_cold int hap_init(AVCodecContext *avctx)
     case HAP_FMT_RGBDXT1:
         ratio = 8;
         avctx->codec_tag = MKTAG('H', 'a', 'p', '1');
+        avctx->bits_per_coded_sample = 24;
         ctx->tex_fun = ctx->dxtc.dxt1_block;
         break;
     case HAP_FMT_RGBADXT5:
         ratio = 4;
         avctx->codec_tag = MKTAG('H', 'a', 'p', '5');
+        avctx->bits_per_coded_sample = 32;
         ctx->tex_fun = ctx->dxtc.dxt5_block;
         break;
     case HAP_FMT_YCOCGDXT5:
         ratio = 4;
         avctx->codec_tag = MKTAG('H', 'a', 'p', 'Y');
+        avctx->bits_per_coded_sample = 24;
         ctx->tex_fun = ctx->dxtc.dxt5ys_block;
         break;
     default: