Message ID | AM7PR03MB6660492285BFE231577471528F6F9@AM7PR03MB6660.eurprd03.prod.outlook.com |
---|---|
State | Accepted |
Commit | cd693c9ec8a83eca7c5e79c454a451c7936749c5 |
Headers | show |
Series | [FFmpeg-devel,1/6] avcodec/movtextdec: Switch to smaller type | expand |
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
andriy/make_ppc | success | Make finished |
andriy/make_fate_ppc | success | Make fate finished |
On Wed, 8 Dec 2021 21:17:38 +0100 Andreas Rheinhardt <andreas.rheinhardt@outlook.com> wrote: > The base size of a box refers to the size the box has in a file, > not in memory; so size_t is not their natural type. Therefore use > a plain unsigned which is smaller on 64bit systems and still big > enough to represent any conceivable base size. Series looks good. Thanks again. --phil
diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c index b0c54bf1d0..8dd571d64c 100644 --- a/libavcodec/movtextdec.c +++ b/libavcodec/movtextdec.c @@ -111,7 +111,7 @@ typedef struct { typedef struct { uint32_t type; - size_t base_size; + unsigned base_size; int (*decode)(const uint8_t *tsmb, MovTextContext *m, const AVPacket *avpkt); } Box;
The base size of a box refers to the size the box has in a file, not in memory; so size_t is not their natural type. Therefore use a plain unsigned which is smaller on 64bit systems and still big enough to represent any conceivable base size. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/movtextdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)