diff options
author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2012-03-19 11:58:15 +0100 |
---|---|---|
committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2012-03-19 12:02:45 +0100 |
commit | 58816039c2846b0781b64e448c4e9ec28a6a3586 (patch) | |
tree | 43bbe942d8e8c95e26c46c2597ab5267b2312cb1 | |
parent | 19121249bd5dcfca440f276e2e05faf84245002c (diff) |
flacparse: avoid indefinite extended search for frame end if possible
... which is particularly useful if locked on to the wrong frame start
and/or corrupt frame being crc checked.
-rw-r--r-- | gst/audioparsers/gstflacparse.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gst/audioparsers/gstflacparse.c b/gst/audioparsers/gstflacparse.c index 9cfdb9810..942914e10 100644 --- a/gst/audioparsers/gstflacparse.c +++ b/gst/audioparsers/gstflacparse.c @@ -691,6 +691,15 @@ gst_flac_parse_frame_is_valid (GstFlacParse * flacparse, } } + /* so we searched to expected end and found nothing, + * give up on this frame (start) */ + if (flacparse->max_framesize && i > 2 * flacparse->max_framesize) { + GST_LOG_OBJECT (flacparse, + "could not determine valid frame end, discarding frame (start)"); + *ret = 1; + return FALSE; + } + need_more: max = flacparse->max_framesize + 16; if (max == 16) |