On Thu, Sep 26, 2024 at 09:51:48PM +0200, Michael Niedermayer wrote: > Hi Traneptora > > On Wed, Sep 25, 2024 at 06:52:52PM -0400, Leo Izen wrote: > > On 9/25/24 4:06 AM, Michael Niedermayer wrote: > > > Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc> [...] > > > if (f->ec) { > > > - unsigned crc = av_crc(av_crc_get_table(AV_CRC_32_IEEE), 0, > > > buf_p, v); > > > - if (crc) { > > > + unsigned crc = av_crc(av_crc_get_table(AV_CRC_32_IEEE), > > > f->crcref, buf_p, v); > > > > Do we require sizeof(unsigned int) == 4? > > no > > > > Whether or not, it may be more readable to declare crc as a uint32_t > > maybe, but that belongs in a seperate patch
it seems to have the opposit effect see: (especially the av_log()) diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index b4d719a7eec..9efc926092c 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -509,11 +509,11 @@ static int read_extra_header(FFV1Context *f) } if (f->version > 2) { - unsigned v; + uint32_t v; v = av_crc(av_crc_get_table(AV_CRC_32_IEEE), f->crcref, f->avctx->extradata, f->avctx->extradata_size); if (v != f->crcref || f->avctx->extradata_size < 4) { - av_log(f->avctx, AV_LOG_ERROR, "CRC mismatch %X!\n", v); + av_log(f->avctx, AV_LOG_ERROR, "CRC mismatch %"PRIX32"!\n", v); return AVERROR_INVALIDDATA; } crc = AV_RB32(f->avctx->extradata + f->avctx->extradata_size - 4); @@ -950,10 +950,10 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, buf_p -= v; if (f->ec) { - unsigned crc = av_crc(av_crc_get_table(AV_CRC_32_IEEE), f->crcref, buf_p, v); + uint32_t crc = av_crc(av_crc_get_table(AV_CRC_32_IEEE), f->crcref, buf_p, v); if (crc != f->crcref) { int64_t ts = avpkt->pts != AV_NOPTS_VALUE ? avpkt->pts : avpkt->dts; - av_log(f->avctx, AV_LOG_ERROR, "slice CRC mismatch %X!", crc); + av_log(f->avctx, AV_LOG_ERROR, "slice CRC mismatch %"PRIX32"!", crc); if (ts != AV_NOPTS_VALUE && avctx->pkt_timebase.num) { av_log(f->avctx, AV_LOG_ERROR, "at %f seconds\n", ts*av_q2d(avctx->pkt_timebase)); } else if (ts != AV_NOPTS_VALUE) { [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No snowflake in an avalanche ever feels responsible. -- Voltaire
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".