aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-01 18:03:54 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-01 18:03:54 +0100
commit5c37ffca59e7eb1b8768f237deb35a9936c1a0a5 (patch)
tree98664610398f2e756980b1234aa4c0628216cd13
parentd25d9296003465d60a968147f7b722823f22272d (diff)
downloadffmpeg-5c37ffca59e7eb1b8768f237deb35a9936c1a0a5.tar.gz
avformat/flvdec: add several error messages to error conditions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/flvdec.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 54f2f56dba..8a4addb12f 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -405,8 +405,10 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream,
num_val = avio_r8(ioc);
break;
case AMF_DATA_TYPE_STRING:
- if (amf_get_string(ioc, str_val, sizeof(str_val)) < 0)
+ if (amf_get_string(ioc, str_val, sizeof(str_val)) < 0) {
+ av_log(s, AV_LOG_ERROR, "AMF_DATA_TYPE_STRING parsing failed\n");
return -1;
+ }
break;
case AMF_DATA_TYPE_OBJECT:
if ((vstream || astream) && key &&
@@ -421,8 +423,10 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream,
if (amf_parse_object(s, astream, vstream, str_val, max_pos,
depth + 1) < 0)
return -1; // if we couldn't skip, bomb out.
- if (avio_r8(ioc) != AMF_END_OF_OBJECT)
+ if (avio_r8(ioc) != AMF_END_OF_OBJECT) {
+ av_log(s, AV_LOG_ERROR, "Missing AMF_END_OF_OBJECT in AMF_DATA_TYPE_OBJECT\n");
return -1;
+ }
break;
case AMF_DATA_TYPE_NULL:
case AMF_DATA_TYPE_UNDEFINED:
@@ -438,7 +442,10 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream,
depth + 1) < 0)
return -1;
if (avio_r8(ioc) != AMF_END_OF_OBJECT)
+ if (avio_r8(ioc) != AMF_END_OF_OBJECT) {
+ av_log(s, AV_LOG_ERROR, "Missing AMF_END_OF_OBJECT in AMF_DATA_TYPE_MIXEDARRAY\n");
return -1;
+ }
break;
case AMF_DATA_TYPE_ARRAY:
{
@@ -455,6 +462,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream,
avio_skip(ioc, 8 + 2); // timestamp (double) and UTC offset (int16)
break;
default: // unsupported type, we couldn't skip
+ av_log(s, AV_LOG_ERROR, "unsupported amf type %d\n", amf_type);
return -1;
}