[FFmpeg-cvslog] srt: Adjust signedness of sscanf format strings
Diego Biurrun
git at videolan.org
Mon Mar 27 23:08:26 EEST 2017
ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Wed Nov 11 17:40:27 2015 +0100| [3ec6f855d0f21d90a0494fb798c4cf203fdb3db0] | committer: Diego Biurrun
srt: Adjust signedness of sscanf format strings
Fixes several warnings from -Wformat.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3ec6f855d0f21d90a0494fb798c4cf203fdb3db0
---
libavcodec/srtdec.c | 2 +-
libavformat/id3v2.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/srtdec.c b/libavcodec/srtdec.c
index 3bee3c7..4c5f6e5 100644
--- a/libavcodec/srtdec.c
+++ b/libavcodec/srtdec.c
@@ -192,7 +192,7 @@ static const char *read_ts(const char *buf, int *ts_start, int *ts_end,
for (i=0; i<2; i++) {
/* try to read timestamps in either the first or second line */
int c = sscanf(buf, "%d:%2d:%2d%*1[,.]%3d --> %d:%2d:%2d%*1[,.]%3d"
- "%*[ ]X1:%u X2:%u Y1:%u Y2:%u",
+ "%*[ ]X1:%d X2:%d Y1:%d Y2:%d",
&hs, &ms, &ss, ts_start, &he, &me, &se, ts_end,
x1, x2, y1, y2);
buf += strcspn(buf, "\n") + 1;
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index 5e9825d..3f43b4a 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -276,7 +276,7 @@ static void read_ttag(AVFormatContext *s, AVIOContext *pb, int taglen,
}
if (!(strcmp(key, "TCON") && strcmp(key, "TCO")) &&
- (sscanf(dst, "(%d)", &genre) == 1 || sscanf(dst, "%d", &genre) == 1) &&
+ (sscanf(dst, "(%u)", &genre) == 1 || sscanf(dst, "%u", &genre) == 1) &&
genre <= ID3v1_GENRE_MAX) {
av_freep(&dst);
dst = av_strdup(ff_id3v1_genre_str[genre]);
More information about the ffmpeg-cvslog
mailing list