avifIO read() should require readFlags == 0
Since no read flags are defined yet, current implementations of
avifIOReadFunc should require the readFlags parameter be 0.
diff --git a/src/io.c b/src/io.c
index 9f9a03b..341f29d 100644
--- a/src/io.c
+++ b/src/io.c
@@ -27,7 +27,10 @@
{
// printf("avifIOMemoryReaderRead offset %" PRIu64 " size %zu\n", offset, size);
- (void)readFlags;
+ if (readFlags != 0) {
+ // Unsupported readFlags
+ return AVIF_RESULT_IO_ERROR;
+ }
avifIOMemoryReader * reader = (avifIOMemoryReader *)io;
@@ -78,7 +81,10 @@
{
// printf("avifIOFileReaderRead offset %" PRIu64 " size %zu\n", offset, size);
- (void)readFlags;
+ if (readFlags != 0) {
+ // Unsupported readFlags
+ return AVIF_RESULT_IO_ERROR;
+ }
avifIOFileReader * reader = (avifIOFileReader *)io;
diff --git a/tests/aviftest.c b/tests/aviftest.c
index 5301f5b..d7bdea6 100644
--- a/tests/aviftest.c
+++ b/tests/aviftest.c
@@ -265,7 +265,10 @@
{
// printf("avifIOTestReaderRead offset %" PRIu64 " size %zu\n", offset, size);
- (void)readFlags;
+ if (readFlags != 0) {
+ // Unsupported readFlags
+ return AVIF_RESULT_IO_ERROR;
+ }
avifIOTestReader * reader = (avifIOTestReader *)io;