[soc]: r5371 - wmapro/wmaprodec.c
Author: faust3 Date: Mon Aug 31 20:07:50 2009 New Revision: 5371 Log: let decode_subframe_length return < 0 in case of errors Modified: wmapro/wmaprodec.c Modified: wmapro/wmaprodec.c ============================================================================== --- wmapro/wmaprodec.c Mon Aug 31 20:00:54 2009 (r5370) +++ wmapro/wmaprodec.c Mon Aug 31 20:07:50 2009 (r5371) @@ -450,7 +450,7 @@ static av_cold int decode_init(AVCodecCo *@brief Decode the subframe length. *@param s context *@param offset sample offset in the frame - *@return decoded subframe length on success, 0 in case of an error + *@return decoded subframe length on success, < 0 in case of an error */ static int decode_subframe_length(WMA3DecodeContext *s, int offset) { @@ -475,7 +475,7 @@ static int decode_subframe_length(WMA3De || subframe_len > s->samples_per_frame) { av_log(s->avctx, AV_LOG_ERROR, "broken frame: subframe_len %i\n", subframe_len); - return 0; + return AVERROR_INVALIDDATA; } return subframe_len; } @@ -541,7 +541,7 @@ static int decode_tilehdr(WMA3DecodeCont } /** get subframe length */ - if (!(subframe_len = decode_subframe_length(s, min_channel_len))) + if ((subframe_len = decode_subframe_length(s, min_channel_len)) <= 0) return AVERROR_INVALIDDATA; /** add subframes to the individual channels and find new min_channel_len */
Hi, On Mon, Aug 31, 2009 at 2:07 PM, faust3<subversion@mplayerhq.hu> wrote:
+ *@return decoded subframe length on success, < 0 in case of an error [..] - if (!(subframe_len = decode_subframe_length(s, min_channel_len))) + if ((subframe_len = decode_subframe_length(s, min_channel_len)) <= 0)
<= should be <. Ronald
Hi, On Montag, 31. August 2009, Ronald S. Bultje wrote:
Hi,
On Mon, Aug 31, 2009 at 2:07 PM, faust3<subversion@mplayerhq.hu> wrote:
+ *@return decoded subframe length on success, < 0 in case of an error
[..]
- if (!(subframe_len = decode_subframe_length(s, min_channel_len))) + if ((subframe_len = decode_subframe_length(s, min_channel_len)) <= 0)
<= should be <.
subframe_len == 0 might be no error for decode_subframe_length But it is an error for the calling function in this case. (Although this should not happen with the current implementation) Regards Sascha
Hi Sascha, On Mon, Aug 31, 2009 at 2:28 PM, Sascha Sommer<saschasommer@freenet.de> wrote:
On Montag, 31. August 2009, Ronald S. Bultje wrote:
On Mon, Aug 31, 2009 at 2:07 PM, faust3<subversion@mplayerhq.hu> wrote:
+ *@return decoded subframe length on success, < 0 in case of an error
[..]
- if (!(subframe_len = decode_subframe_length(s, min_channel_len))) + if ((subframe_len = decode_subframe_length(s, min_channel_len)) <= 0)
<= should be <.
subframe_len == 0 might be no error for decode_subframe_length But it is an error for the calling function in this case. (Although this should not happen with the current implementation)
Of course - could you clarify that with a comment to prevent more dummy questions like mine? :-). Great work btw! Ronald
Hi, On Montag, 31. August 2009, Ronald S. Bultje wrote:
Hi Sascha,
On Mon, Aug 31, 2009 at 2:28 PM, Sascha Sommer<saschasommer@freenet.de> wrote:
On Montag, 31. August 2009, Ronald S. Bultje wrote:
On Mon, Aug 31, 2009 at 2:07 PM, faust3<subversion@mplayerhq.hu> wrote:
+ *@return decoded subframe length on success, < 0 in case of an error
[..]
- if (!(subframe_len = decode_subframe_length(s, min_channel_len))) + if ((subframe_len = decode_subframe_length(s, min_channel_len)) <= 0)
<= should be <.
subframe_len == 0 might be no error for decode_subframe_length But it is an error for the calling function in this case. (Although this should not happen with the current implementation)
Of course - could you clarify that with a comment to prevent more dummy questions like mine? :-).
Done.
Great work btw!
Thanks. Regards Sascha
participants (3)
-
faust3 -
Ronald S. Bultje -
Sascha Sommer