[FFmpeg-devel,4/4] cbs_mpeg2: Correct error codes

Submitted by Andreas Rheinhardt on April 23, 2019, 8:32 p.m.

Details

Message ID 20190423203230.4742-4-andreas.rheinhardt@gmail.com
State New
Headers show

Commit Message

Andreas Rheinhardt April 23, 2019, 8:32 p.m.
Up until now, things that are merely unsupported by cbs_mpeg2 have been
declared to be invalid input. This has been changed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/cbs_mpeg2.c                 | 4 +---
 libavcodec/cbs_mpeg2_syntax_template.c | 4 ++--
 2 files changed, 3 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libavcodec/cbs_mpeg2.c b/libavcodec/cbs_mpeg2.c
index 96c2d2c22e..fce881d1c3 100644
--- a/libavcodec/cbs_mpeg2.c
+++ b/libavcodec/cbs_mpeg2.c
@@ -245,9 +245,7 @@  static int cbs_mpeg2_read_unit(CodedBitstreamContext *ctx,
                                                group_of_pictures_header, NULL);
 #undef START
         default:
-            av_log(ctx->log_ctx, AV_LOG_ERROR, "Unknown start code %02"PRIx32".\n",
-                   unit->type);
-            return AVERROR_INVALIDDATA;
+            return AVERROR(ENOSYS);
         }
     }
 
diff --git a/libavcodec/cbs_mpeg2_syntax_template.c b/libavcodec/cbs_mpeg2_syntax_template.c
index f2718635c2..9aa8a378c9 100644
--- a/libavcodec/cbs_mpeg2_syntax_template.c
+++ b/libavcodec/cbs_mpeg2_syntax_template.c
@@ -323,9 +323,9 @@  static int FUNC(extension_data)(CodedBitstreamContext *ctx, RWContext *rw,
         return FUNC(picture_coding_extension)
             (ctx, rw, &current->data.picture_coding);
     default:
-        av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid extension ID %d.\n",
+        av_log(ctx->log_ctx, AV_LOG_ERROR, "Extension ID %d not supported.\n",
                current->extension_start_code_identifier);
-        return AVERROR_INVALIDDATA;
+        return AVERROR_PATCHWELCOME;
     }
 }