Message ID | AM7PR03MB6660C5378642A973A89AC8548FA39@AM7PR03MB6660.eurprd03.prod.outlook.com |
---|---|
State | Accepted |
Commit | 0f12d79a88fcd08789fe826e40ea7d1324896b18 |
Headers | show |
Series | [FFmpeg-devel,01/27] avformat/astenc: Simplify writing padding | 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 |
lgtm if ffio_fill does not turn negative argument into very positive one.
Paul B Mahol: > lgtm if ffio_fill does not turn negative argument into very positive one. > ffio_fill does not do that; and the argument here is always nonnegative. Here is the loop: while (size > 0) { int len = size; // size is an int and > 0 and so is len is now if (len > 14) len = 14; /* From here on len is always <= 14 */ avio_w8(out, 1); /* immediate constructor */ avio_w8(out, len); /* amount of valid data */ avio_write(out, data, len); data += len; size -= len; for (; len < 14; len++) avio_w8(out, 0); (*entries)++; }
diff --git a/libavformat/movenchint.c b/libavformat/movenchint.c index 47276091f3..35212f2c5d 100644 --- a/libavformat/movenchint.c +++ b/libavformat/movenchint.c @@ -260,8 +260,7 @@ static void output_immediate(const uint8_t *data, int size, data += len; size -= len; - for (; len < 14; len++) - avio_w8(out, 0); + ffio_fill(out, 0, 14 - len); (*entries)++; }
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavformat/movenchint.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)