[FFmpeg-devel] [PATCH] oggdec: in ogg_read_header(), fail if ogg_get_length() fails
Stefano Sabatini
stefano.sabatini-lala at poste.it
Tue May 24 16:18:34 CEST 2011
Check error value of ogg_get_length(), and return its error code in
case of failure. This looks required in case of memory problems.
---
libavformat/oggdec.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 704cab0..f159af4 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -529,7 +529,8 @@ static int ogg_read_header(AVFormatContext *s, AVFormatParameters *ap)
ogg->streams[i].codec = NULL;
//linear granulepos seek from end
- ogg_get_length (s);
+ if ((ret = ogg_get_length(s)) < 0)
+ return ret;
//fill the extradata in the per codec callbacks
return 0;
--
1.7.2.3
More information about the ffmpeg-devel
mailing list